From da68365153a6497b63beb02b8b588a2b13e85755 Mon Sep 17 00:00:00 2001 From: 6543 Date: Thu, 26 Apr 2018 20:58:19 +0200 Subject: [PATCH] restructure: seperate config --- changes/remaster.md | 2 ++ gendeb.sh | 34 +++++++++++++++------- src/config.sample.cfg | 39 +++++++++++++++++++++++++ src/dist/desinfect17 | 0 src/dist/ubuntu.16.04 | 0 src/functions/chroot_clean | 0 src/mods/xrdp | 0 src/pxe/pxe.cfg | 0 src/remaster.sh | 59 ++++++++++++++++---------------------- src/web/index.html | 0 10 files changed, 89 insertions(+), 45 deletions(-) create mode 100644 src/config.sample.cfg create mode 100644 src/dist/desinfect17 create mode 100644 src/dist/ubuntu.16.04 create mode 100644 src/functions/chroot_clean create mode 100644 src/mods/xrdp create mode 100644 src/pxe/pxe.cfg create mode 100644 src/web/index.html diff --git a/changes/remaster.md b/changes/remaster.md index e69de29..7774b43 100644 --- a/changes/remaster.md +++ b/changes/remaster.md @@ -0,0 +1,2 @@ +2018-04-26 - 1.9.1 + * seperate script and config diff --git a/gendeb.sh b/gendeb.sh index c1041ed..11bd7ae 100755 --- a/gendeb.sh +++ b/gendeb.sh @@ -1,25 +1,39 @@ #!/bin/bash # at the moment only generate dir structure in /build -# setup build dir -rootfs=build +##################### +## setup build dir ## +##################### + +rootdir=build echo "clear build" -[ -d $rootfs ] && rm -v -R $rootfs -mkdir $rootfs +[ -d $rootdir ] && rm -v -R $rootdir +mkdir $rootdir + +###################### +## skripte copieren ## +###################### echo "copy files" -## skripte copieren + # remaster -mkdir -p $rootfs/usr/bin/ -cp -v src/remaster.sh $rootfs/usr/bin/remaster -chmod +x $rootfs/usr/bin/remaster +mkdir -p $rootdir/usr/bin/ +cp -v src/remaster.sh $rootdir/usr/bin/remaster +chmod +x $rootdir/usr/bin/remaster + # modules -mkdir -p $rootfs/usr/lib/remaster/ -#... +mkdir -p $rootdir/usr/lib/remaster/ +for i in dist functions mods; do + cp -v src/$i/* $rootdir/usr/lib/remaster/ +done + +# setting +cp -v src/config.sample.cfg $rootdir/etc/remaster/config.sample.cfg # Pfade anpassen #sed ... + #mkdeb... #not jet diff --git a/src/config.sample.cfg b/src/config.sample.cfg new file mode 100644 index 0000000..b16bc57 --- /dev/null +++ b/src/config.sample.cfg @@ -0,0 +1,39 @@ +#cfg + +######################################################### +## sample-config rename it to config.cfg after changes ## +######################################################### + +## MODUS +modus_default="update_pxe" + +#CD/DVD +#entweder iso_source oder filesystem_source alls quelle +# -> bei iso gen erforderlich! +iso_source="/data/remaster/desinfect-2017.iso" +#destination optinal +iso_destination="/data/remaster/result/custom_desinfect_`date '+%Y-%m-%d'`.iso" +iso_lable="DESINFECT_`date '+%Y-%m-%d'`" + +#Filesystem (for pxe) +#entweder iso_source oder filesystem_source alls quelle +filesystem_source="/data/remaster/result/filesystem.squashfs" + +#Network +proxy_host="proxy.local" +proxy_port="8080" +domain="local" +nameserver="10.x.x.2,10.x.x.1" + +#remaster_script +distro="desinfect2017" + +#LOG +log_file="/data/remaster/logs/`date '+%Y-%m-%d'`.log" +log_mail_source="desinfect@email.clocal" +log_mail_smtp="smtp.mail.local:25" +log_mail_aim="6543@email.clocal" +log_mail_subject="Desinfect_Remaster" + +#Sonstiges +tools_list="xrdp clamav nano htop nmon iftop tmux dsniff nmap openssh-server tightvncserver rsync e2fsprogs foremost gddrescue recoverjpeg safecopy sleuthkit testdisk arp-scan" diff --git a/src/dist/desinfect17 b/src/dist/desinfect17 new file mode 100644 index 0000000..e69de29 diff --git a/src/dist/ubuntu.16.04 b/src/dist/ubuntu.16.04 new file mode 100644 index 0000000..e69de29 diff --git a/src/functions/chroot_clean b/src/functions/chroot_clean new file mode 100644 index 0000000..e69de29 diff --git a/src/mods/xrdp b/src/mods/xrdp new file mode 100644 index 0000000..e69de29 diff --git a/src/pxe/pxe.cfg b/src/pxe/pxe.cfg new file mode 100644 index 0000000..e69de29 diff --git a/src/remaster.sh b/src/remaster.sh index acd46d5..0cddef8 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -1,47 +1,36 @@ #!/bin/bash -#@version 1.9.0 +#@version 1.9.1 #@autor 6543@obermui.de -#@date 2018-03-26 +#@date 2018-04-26 #@licence GNUv3 ##################################################################################### ################## S e t t i n g s ################################################## ##################################################################################### +#get base dir +rootdir=`echo $0 | rev | cut -d "/" -f 2- | rev`/../../ +rootdir=`readlink -e $rootdir` -## MODUS -modus_default="update_pxe" - -#CD/DVD -#entweder iso_source oder filesystem_source alls quelle -# -> bei iso gen erforderlich! -iso_source="/data/remaster/desinfect-2017.iso" -#destination optinal -iso_destination="/data/remaster/result/custom_desinfect_`date '+%Y-%m-%d'`.iso" -iso_lable="DESINFECT_`date '+%Y-%m-%d'`" - -#Filesystem (for pxe) -#entweder iso_source oder filesystem_source alls quelle -filesystem_source="/data/remaster/result/filesystem.squashfs" - -#Network -proxy_host="proxy.local" -proxy_port="8080" -domain="local" -nameserver="10.x.x.2,10.x.x.1" - -#remaster_script -distro="desinfect2017" - -#LOG -log_file="/data/remaster/logs/`date '+%Y-%m-%d'`.log" -log_mail_source="desinfect@email.clocal" -log_mail_smtp="smtp.mail.local:25" -log_mail_aim="6543@email.clocal" -log_mail_subject="Desinfect_Remaster" - -#Sonstiges -tools_list="xrdp clamav nano htop nmon iftop tmux dsniff nmap openssh-server tightvncserver rsync e2fsprogs foremost gddrescue recoverjpeg safecopy sleuthkit testdisk arp-scan" +#set functions +if [ -p "$rootdir/usr/lib/remaster/" ]; then + #source "$rootdir/usr/lib/remaster/" ... + export PATH="$rootdir/usr/lib/remaster/":$PATH +else + echo "ERROR functions not found" + exit 1 +fi +#read main setting +if [ -f "$rootdir/etc/remaster/config.cfg"]; then + source "$rootdir/etc/remaster/config.cfg" +else + if [ -f "$rootdir/etc/remaster/config.sample.cfg"]; then + source "$rootdir/etc/remaster/config.sample.cfg" + else + echo "ERROR config not found" + exit 1 + fi +fi ##################################################################################### ################## M o d e s ######################################################## diff --git a/src/web/index.html b/src/web/index.html new file mode 100644 index 0000000..e69de29