From 55a17ad2cec013e73b7438412cc1276520250187 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 17 May 2018 01:04:21 +0200 Subject: [PATCH 01/55] beautysh --- src/func/on_exit | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/func/on_exit b/src/func/on_exit index 0801b75..9a33c01 100755 --- a/src/func/on_exit +++ b/src/func/on_exit @@ -4,28 +4,28 @@ #on_exit [error_level] function on_exit() { - #send log and errorlevel[success/errorr xy] + #send log and errorlevel[success/errorr xy] - if [ "$1" != "0" ]; then - log_mail_subject="$log_mail_subject [ERROR]" - else - log_mail_subject="$log_mail_subject [Success]" - fi + if [ "$1" != "0" ]; then + log_mail_subject="$log_mail_subject [ERROR]" + else + log_mail_subject="$log_mail_subject [Success]" + fi - #Mail Body: - for mail_aim in `echo "$log_mail_aim" | tr "," " "`; do - { - echo "$log_mail_subject" - echo $'####################################################################################\n\n' - cat "$log_file" - } | sendemail -s "$log_mail_smtp" -f "$log_mail_source" -t "$mail_aim" -u "$log_mail_subject" -o tls=no - done + #Mail Body: + for mail_aim in `echo "$log_mail_aim" | tr "," " "`; do + { + echo "$log_mail_subject" + echo $'####################################################################################\n\n' + cat "$log_file" + } | sendemail -s "$log_mail_smtp" -f "$log_mail_source" -t "$mail_aim" -u "$log_mail_subject" -o tls=no + done - [ "$1" != "0" ] && { - chroot_umount$distro "$chroot_path" 2> /dev/null - workspace_erase "$iso_extr_dir/" "$chroot_path/" 2> /dev/null - } - exit $1 + [ "$1" != "0" ] && { + chroot_umount$distro "$chroot_path" 2> /dev/null + workspace_erase "$iso_extr_dir/" "$chroot_path/" 2> /dev/null + } + exit $1 } #this func is standalone executable From ca02c443d39beaa97310d8a36cc0a186b824a1d8 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 17 May 2018 01:05:56 +0200 Subject: [PATCH 02/55] make mail optional --- src/func/on_exit | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/func/on_exit b/src/func/on_exit index 9a33c01..59774f1 100755 --- a/src/func/on_exit +++ b/src/func/on_exit @@ -4,23 +4,26 @@ #on_exit [error_level] function on_exit() { - #send log and errorlevel[success/errorr xy] + ### send mail + [ -n "$log_mail_aim" ] && { + #send log and errorlevel[success/errorr xy] + if [ "$1" != "0" ]; then + log_mail_subject="$log_mail_subject [ERROR]" + else + log_mail_subject="$log_mail_subject [Success]" + fi - if [ "$1" != "0" ]; then - log_mail_subject="$log_mail_subject [ERROR]" - else - log_mail_subject="$log_mail_subject [Success]" - fi - - #Mail Body: - for mail_aim in `echo "$log_mail_aim" | tr "," " "`; do - { - echo "$log_mail_subject" - echo $'####################################################################################\n\n' - cat "$log_file" - } | sendemail -s "$log_mail_smtp" -f "$log_mail_source" -t "$mail_aim" -u "$log_mail_subject" -o tls=no - done + #Mail Body: + for mail_aim in `echo "$log_mail_aim" | tr "," " "`; do + { + echo "$log_mail_subject" + echo $'####################################################################################\n\n' + cat "$log_file" + } | sendemail -s "$log_mail_smtp" -f "$log_mail_source" -t "$mail_aim" -u "$log_mail_subject" -o tls=no + done + } + ### clean up [ "$1" != "0" ] && { chroot_umount$distro "$chroot_path" 2> /dev/null workspace_erase "$iso_extr_dir/" "$chroot_path/" 2> /dev/null From d0c53279b5f58987a8d9b6b1256993174d69b51e Mon Sep 17 00:00:00 2001 From: 6543 Date: Sat, 19 May 2018 22:45:42 +0200 Subject: [PATCH 03/55] update Dependencys <- update feature --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 780fda9..b1c35b1 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ The aim of this Project is to create a daemon for a server, witch update live sy - wget - sed - sendemail +- curl ## To Do From 5767355c217d799313fd001e64a382f1511b8f17 Mon Sep 17 00:00:00 2001 From: 6543 Date: Sun, 20 May 2018 00:43:38 +0200 Subject: [PATCH 04/55] draft --- doc/Strukture.md | 80 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/doc/Strukture.md b/doc/Strukture.md index f209963..ad599c5 100644 --- a/doc/Strukture.md +++ b/doc/Strukture.md @@ -1,28 +1,70 @@ -# Src +1. Starte "remaster" -raw scripts .. +1.1 Lade Grundfunctionen [-> #functions] -## functions +1.2 Überprüfe ... + * auf Updates + * auf Rechte - - creat iso - - burn cd ... - - clean workspace ... +1.3 Lade Richtige Einstellungen [-> #config] + * Lade /etc/remaster/ + * Überprüfe Conf. (Proj Exist; Mods Exist; ...) +1.4 Lade Proj-Func [-> #projects] + * Überlade nach Abhängigkeit + * (z.B. ubuntu.16.04 -> ubuntu -> debian) + * Prüfe Conf. (Proj Conform) -## distros +1.5 Lade $n Mods (optional) [-> #mods] + * Überprüfen + * Spechern in MOD_LST -scripts vor distros - - update - - set network settings - - set OS settings +2. Init Chroot -## mods - - for example: install & enable xrdp - - set default passwd - - ... +2.1 Dateien Entpacken + * ISO + * Squashfs -## web -placeholder for webfiles ... +2.2 Config für Chroot (chroot_initial) + * (lxc-conf / tmpdir) + * Netzwerk -## pxe -placeholder for pxefiles ... +2.3 Starte Chroot + * (lxc-start / mount ...) + +3. Modivikationen + +3.1 Netzwerk + +3.2 Proj-Spez. + * (z.B. Desinfect: conky_info) + +3.3 Packet Mgr + * Updates + * Install + * Delete + +3.4 Weitere in $MOD_LST + * z.B. xrdp + * z.B. default pw + +4. Finish + +4.1 Aufreumen Live-Sys + * tmpfiles + * Packet Mgr + +4.2 Stop chroot + * Umount + +4.3. Gen ISO/PXE + +4.4. Del Chroot + +5. Send Log + +---- + +lxc +-> chroot_sh exec lxc-attach +-> chroot_dir = container name From 897ddfd3a613ba7ab4c9448c033ed83fbcaff351 Mon Sep 17 00:00:00 2001 From: 6543 Date: Sun, 20 May 2018 01:13:03 +0200 Subject: [PATCH 05/55] format --- doc/Strukture.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/Strukture.md b/doc/Strukture.md index ad599c5..bd90ec3 100644 --- a/doc/Strukture.md +++ b/doc/Strukture.md @@ -1,67 +1,67 @@ -1. Starte "remaster" +# 1. Starte "remaster" -1.1 Lade Grundfunctionen [-> #functions] +## 1.1 Lade Grundfunctionen [-> #functions] -1.2 Überprüfe ... +## 1.2 Überprüfe ... * auf Updates * auf Rechte -1.3 Lade Richtige Einstellungen [-> #config] +## 1.3 Lade Richtige Einstellungen [-> #config] * Lade /etc/remaster/ * Überprüfe Conf. (Proj Exist; Mods Exist; ...) -1.4 Lade Proj-Func [-> #projects] +## 1.4 Lade Proj-Func [-> #projects] * Überlade nach Abhängigkeit * (z.B. ubuntu.16.04 -> ubuntu -> debian) * Prüfe Conf. (Proj Conform) -1.5 Lade $n Mods (optional) [-> #mods] +## 1.5 Lade $n Mods (optional) [-> #mods] * Überprüfen * Spechern in MOD_LST -2. Init Chroot +# 2. Init Chroot -2.1 Dateien Entpacken +## 2.1 Dateien Entpacken * ISO * Squashfs -2.2 Config für Chroot (chroot_initial) +## 2.2 Config für Chroot (chroot_initial) * (lxc-conf / tmpdir) * Netzwerk -2.3 Starte Chroot +## 2.3 Starte Chroot * (lxc-start / mount ...) -3. Modivikationen +# 3. Modivikationen -3.1 Netzwerk +## 3.1 Netzwerk -3.2 Proj-Spez. +## 3.2 Proj-Spez. * (z.B. Desinfect: conky_info) -3.3 Packet Mgr +## 3.3 Packet Mgr * Updates * Install * Delete -3.4 Weitere in $MOD_LST +## 3.4 Weitere in $MOD_LST * z.B. xrdp * z.B. default pw -4. Finish +# 4. Finish -4.1 Aufreumen Live-Sys +## 4.1 Aufreumen Live-Sys * tmpfiles * Packet Mgr -4.2 Stop chroot +## 4.2 Stop chroot * Umount -4.3. Gen ISO/PXE +## 4.3. Gen ISO/PXE -4.4. Del Chroot +## 4.4. Del Chroot -5. Send Log +# 5. Send Log ---- From ff9a384ce636589fb24156fda5b292e9e0131d34 Mon Sep 17 00:00:00 2001 From: 6543 Date: Sun, 20 May 2018 01:29:25 +0200 Subject: [PATCH 06/55] draft_v2 --- doc/Strukture.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/doc/Strukture.md b/doc/Strukture.md index bd90ec3..434d51f 100644 --- a/doc/Strukture.md +++ b/doc/Strukture.md @@ -65,6 +65,47 @@ ---- -lxc +## lxc + -> chroot_sh exec lxc-attach + -> chroot_dir = container name + +---- + +## PXE + +-> Install + * DHCP Relay + * NFS-Server + * TFTP-Server + * [Samba] + +-> Setup + * (use /proj/ func) + * SMB/NFS LiveSys export + * TFTP (Boot Menue; Boot Loader; Kernel&Initrd) + +-> Deinstall + * RM TFTP-Root + * RM SMB/NFS LiveSys export + * del DHCP Relay conf + +---- + +## Jobs + +---- + +## Web + +show/edit #Configs + +show (+live) #Logs + +start/stop/plan #Jobs + +start/stop/edit #PXE menue + * default + * all / single / none + * live view new clients From 6aa13ce326d79e810d589f4390b489d326b6512c Mon Sep 17 00:00:00 2001 From: 6543 Date: Sun, 20 May 2018 01:34:10 +0200 Subject: [PATCH 07/55] draft_v3 --- doc/Strukture.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/Strukture.md b/doc/Strukture.md index 434d51f..0a6e53f 100644 --- a/doc/Strukture.md +++ b/doc/Strukture.md @@ -94,6 +94,8 @@ ---- ## Jobs + * Read Confs -> get time interfall I + * Exec remaster for I ---- From d65cddc2f5a6495713b14d5710fa0785933ce7a0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 11:59:47 +0200 Subject: [PATCH 08/55] proxy optional --- src/remaster.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/remaster.sh b/src/remaster.sh index 9fded8b..4abfee6 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -113,9 +113,10 @@ function main_renew() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Setzen der Netzwerk-Einstellungen: - - proxy_enable$distro "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + [ -n "$proxy_host" ] && { + proxy_enable$distro "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + } dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" @@ -397,9 +398,10 @@ function main_update_iso() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Setzen der Netzwerk-Einstellungen: - - proxy_enable$distro "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + [ -n "$proxy_host" ] && { + proxy_enable$distro "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + } dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" From 22c8d8081eaad2f00639eefb344a31e8ad5ec8bd Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 12:24:51 +0200 Subject: [PATCH 09/55] Load check_update func --- src/remaster.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/remaster.sh b/src/remaster.sh index 9fded8b..449fc61 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -490,6 +490,8 @@ source /func/check_user # -> 0 | -> 16 source /func/check_dependency +#check_update +source /func/check_update ### Workspace ### From fb4afed081f92630905076b79f8a9d53c279e1ad Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 20:32:55 +0200 Subject: [PATCH 10/55] subvers --- DEBIAN/control | 2 +- changes/remaster.md | 4 ++++ script/get_version.sh | 3 +++ script/set_version.sh | 6 +++--- src/remaster.sh | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) create mode 100755 script/get_version.sh diff --git a/DEBIAN/control b/DEBIAN/control index e35de60..546040e 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -1,6 +1,6 @@ Package: remaster Source: remaster -Version: 2.0.2 +Version: 2.0.2-2 Architecture: all Maintainer: 6543 <6543@obermui.de> Installed-Size: diff --git a/changes/remaster.md b/changes/remaster.md index eb79d3f..d910dfe 100644 --- a/changes/remaster.md +++ b/changes/remaster.md @@ -18,3 +18,7 @@ 2018-05-13 - 2.0.2 * hotfix-2.0.2 ( create release folder if not exist ) + +2018-05-20 - 2.0.2-2 + * make email, proxy optional + * change Strukture.md diff --git a/script/get_version.sh b/script/get_version.sh new file mode 100755 index 0000000..e58d5ec --- /dev/null +++ b/script/get_version.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +grep '@version ' src/remaster.sh | cut -d " " -f 2 diff --git a/script/set_version.sh b/script/set_version.sh index d170fe9..e012b21 100755 --- a/script/set_version.sh +++ b/script/set_version.sh @@ -8,10 +8,10 @@ date=`date +%Y-%m-%d` version_sed=`echo $version | sed 's/\./\\./g'` #nummer - sed -i "s/@version\ .\..\../@version\ $version_sed/g" src/remaster.sh + sed -i "/#@version\ /c\#@version\ $version_sed" src/remaster.sh #datum - sed -i "s/@date\ ....-..-../@date\ $date/g" src/remaster.sh + sed -i "/#@date\ /c\#@date\ $date" src/remaster.sh } [ -e "changes/remaster.md" ] && { @@ -22,5 +22,5 @@ date=`date +%Y-%m-%d` } [ -f "DEBIAN/control" ] && { - sed -i "s/Version:\ .\..\../Version:\ $version_sed/g" "DEBIAN/control" + sed -i "/Version:\ /c\Version:\ $version_sed" "DEBIAN/control" } diff --git a/src/remaster.sh b/src/remaster.sh index 5a740d3..8874202 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -1,7 +1,7 @@ #!/bin/bash -#@version 2.0.2 +#@version 2.0.2-2 #@autor 6543@obermui.de -#@date 2018-05-13 +#@date 2018-05-20 #@licence GNUv3 ##################################################################################### From 3510f44ef8dad9e643b307a922b5d7c9515f9a73 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 20:50:06 +0200 Subject: [PATCH 11/55] appropriate name --- doc/{lib-header.txt => lib-head+tail} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{lib-header.txt => lib-head+tail} (100%) diff --git a/doc/lib-header.txt b/doc/lib-head+tail similarity index 100% rename from doc/lib-header.txt rename to doc/lib-head+tail From 051f8636a29113521c1d223b8708d8f21122b79b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 21:02:45 +0200 Subject: [PATCH 12/55] init check_config --- src/func/check_config | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 src/func/check_config diff --git a/src/func/check_config b/src/func/check_config new file mode 100755 index 0000000..2b68c8c --- /dev/null +++ b/src/func/check_config @@ -0,0 +1,13 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +# +function () { + #Code of +} + +#this func is standalone executable +[ -n "$1" ] && { + $@ +} From 89053e3ed19c816cb103f4ef701e201c8f348ad4 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 21:16:19 +0200 Subject: [PATCH 13/55] add script --- doc/lib-head+tail | 8 +++++--- script/add_function.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 script/add_function.sh diff --git a/doc/lib-head+tail b/doc/lib-head+tail index d3c48f7..597257f 100644 --- a/doc/lib-head+tail +++ b/doc/lib-head+tail @@ -2,10 +2,12 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#beginn func - +# [param] +function () { + #Code of +} #this func is standalone executable [ -n "$1" ] && { - check_user + $@ } diff --git a/script/add_function.sh b/script/add_function.sh new file mode 100755 index 0000000..17bd495 --- /dev/null +++ b/script/add_function.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +#check param +[ -z "$1" ] && { echo "$0 [name]"; exit 1; } +name="$1" + +#gen function +cp "doc/lib-head+tail" "src/func/$name" +sed -i "s//$name/g" "src/func/$name" + +#open +editor "src/func/$name" From d11b96947c532ac2fa34bfa3f144cdfc79c6040c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 21:53:56 +0200 Subject: [PATCH 14/55] add log check --- src/func/check_config | 27 +++++++++++++++++++++++---- src/remaster.sh | 8 +++----- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/func/check_config b/src/func/check_config index 2b68c8c..3a0653f 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -2,12 +2,31 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -# -function () { - #Code of +#check_config [param] +function check_config() { + + #LOG + [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" + + if [ -f "$log_file" ]; then + echo > "$log_file" + else + #check if folder exist + [ -d "${log_file%/*}" ] || { + # N-> exit 3 + echo "Directory for Log didnt exist" + exit 3 + } + #create LOG + touch "$log_file" + fi + + + + } #this func is standalone executable [ -n "$1" ] && { - $@ + check_config $@ } diff --git a/src/remaster.sh b/src/remaster.sh index 8874202..dd6202f 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -32,8 +32,7 @@ fi #remaster.sh renew function main_renew() { - - [ -f "$log_file" ] || touch "$log_file" + check_config tail -f "$log_file" --pid="$$" & chroot_path="`mktemp -d`" @@ -195,8 +194,7 @@ function main_renew() { #remaster.sh update_pxe function main_update_pxe() { - [ "$log_file" == "" ] && log_file="`mktemp`" - [ -f "$log_file" ] || touch "$log_file" + check_config tail -f "$log_file" --pid="$$" & chroot_path="`mktemp -d`" @@ -308,7 +306,7 @@ function main_update_pxe() { #remaster.sh update_iso #in arbeit function main_update_iso() { - [ -f "$log_file" ] || touch "$log_file" + check_config tail -f "$log_file" --pid="$$" & chroot_path="`mktemp -d`" From 74b3a8b12bca42b48edb4c4a11e6e694628d6e92 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 22:43:33 +0200 Subject: [PATCH 15/55] log check at init --- src/func/check_config | 15 ++++++++------- src/remaster.sh | 32 +++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/func/check_config b/src/func/check_config index 3a0653f..0b1ccec 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -2,15 +2,17 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#check_config [param] +#check_config [log_file] function check_config() { #LOG - [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" + { + log_file=$1 + [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" - if [ -f "$log_file" ]; then + if [ -f "$log_file" ]; then echo > "$log_file" - else + else #check if folder exist [ -d "${log_file%/*}" ] || { # N-> exit 3 @@ -19,9 +21,8 @@ function check_config() { } #create LOG touch "$log_file" - fi - - + fi + } } diff --git a/src/remaster.sh b/src/remaster.sh index dd6202f..be7d97c 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -25,6 +25,23 @@ else exit 1 fi fi +#check LOG +{ + [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" + + if [ -f "$log_file" ]; then + echo > "$log_file" + else + #check if folder exist + [ -d "${log_file%/*}" ] || { + # N-> exit 3 + echo "Directory for Log didnt exist" + exit 3 + } + #create LOG + touch "$log_file" + fi +} ##################################################################################### ################## M o d e s ######################################################## @@ -32,7 +49,7 @@ fi #remaster.sh renew function main_renew() { - check_config + #Start LOG tail -f "$log_file" --pid="$$" & chroot_path="`mktemp -d`" @@ -89,6 +106,9 @@ function main_renew() { check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + check_config "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + check_update | tee -a "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -194,7 +214,7 @@ function main_renew() { #remaster.sh update_pxe function main_update_pxe() { - check_config + #Start LOG tail -f "$log_file" --pid="$$" & chroot_path="`mktemp -d`" @@ -243,6 +263,9 @@ function main_update_pxe() { check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + check_config "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + [ "$distro" != "" ] && distro="_$distro" # 1. Entpacken der Dateien des Live-Systems @@ -306,7 +329,7 @@ function main_update_pxe() { #remaster.sh update_iso #in arbeit function main_update_iso() { - check_config + #Start LOG tail -f "$log_file" --pid="$$" & chroot_path="`mktemp -d`" @@ -365,6 +388,9 @@ function main_update_iso() { check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + check_config "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + [ "$distro" != "" ] && distro="_$distro" # 2. Entpacke ISO From 8b782fa5e1eb7b12a56c61bf9ebf184258d85976 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 22:44:33 +0200 Subject: [PATCH 16/55] add live-system files check --- src/func/check_config | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/func/check_config b/src/func/check_config index 0b1ccec..19eddeb 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -25,6 +25,37 @@ function check_config() { } + #check live-system files + if [ -f "$iso_source" ]; then + if [ -n "$iso_destination" ] && [ -d "${iso_destination%/*}" ]; then + # iso_source -> iso_destination + # iso_source -> squashfs [optinal] + else + if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then + # iso_source -> squashfs + else + # ERROR + echo "No corect AIM in Settings" | tee -a "$log_file" + return 3 + fi + fi + else + if [ -f "$filesystem_source" ]; then + if [ -n "$iso_destination" ]; then + # ERROR + echo "only Squashfs source in Settings, cant creat ISO" | tee -a "$log_file" + return 3 + else + # squashfs -> squashfs + fi + else + # ERROR + echo "No corect Source in Settings" | tee -a "$log_file" + return 3 + fi + fi + + } #this func is standalone executable From cdf2cc900e7c9e4dea0221f293a7e80beb29548d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 22:52:20 +0200 Subject: [PATCH 17/55] add project check --- src/func/check_config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/func/check_config b/src/func/check_config index 19eddeb..d3e33b8 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -25,6 +25,13 @@ function check_config() { } + + #Project + [ -f "/proj/$distro" ] || { + echo "No Project \"$distrp\" is not supported" | tee -a "$log_file" + return 3 + } + #check live-system files if [ -f "$iso_source" ]; then if [ -n "$iso_destination" ] && [ -d "${iso_destination%/*}" ]; then From 242421fbabcdbe1d10b602749341ea0a7d99546b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 22:53:00 +0200 Subject: [PATCH 18/55] format... --- src/func/check_config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/func/check_config b/src/func/check_config index d3e33b8..4e413dc 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -32,7 +32,7 @@ function check_config() { return 3 } - #check live-system files + #live-system files if [ -f "$iso_source" ]; then if [ -n "$iso_destination" ] && [ -d "${iso_destination%/*}" ]; then # iso_source -> iso_destination @@ -63,6 +63,8 @@ function check_config() { fi + + } #this func is standalone executable From 6ce556ef8423acbbd63a9d9f45135bcbb5b6957b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 22:55:54 +0200 Subject: [PATCH 19/55] add lable; smal fix --- src/func/check_config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/func/check_config b/src/func/check_config index 4e413dc..aeb7e5f 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -28,13 +28,16 @@ function check_config() { #Project [ -f "/proj/$distro" ] || { - echo "No Project \"$distrp\" is not supported" | tee -a "$log_file" + echo "No Project \"$distro\" is not supported" | tee -a "$log_file" return 3 } #live-system files if [ -f "$iso_source" ]; then if [ -n "$iso_destination" ] && [ -d "${iso_destination%/*}" ]; then + #Lable + [ -z "$iso_lable" ] && iso_lable="$distro" + # iso_source -> iso_destination # iso_source -> squashfs [optinal] else From 310b670631fcf3071a829e1aaad7aea58b38245c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 23:04:52 +0200 Subject: [PATCH 20/55] aktivate --- src/remaster.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/remaster.sh b/src/remaster.sh index be7d97c..17b3d2b 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -503,6 +503,9 @@ function main_update_iso() { ### Error Handlings ### +#check_config [log_file] +source /func/check_config + #on_exit [error_level] source /func/on_exit From 20bb090cb3f56f051c23840d2b170c79b1c78b50 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 23:12:12 +0200 Subject: [PATCH 21/55] fixes... --- src/func/check_config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/func/check_config b/src/func/check_config index aeb7e5f..8bed903 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -38,11 +38,11 @@ function check_config() { #Lable [ -z "$iso_lable" ] && iso_lable="$distro" - # iso_source -> iso_destination - # iso_source -> squashfs [optinal] + echo 'iso_source -> iso_destination' | tee -a "$log_file" + echo 'iso_source -> squashfs [optinal]' | tee -a "$log_file" else if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then - # iso_source -> squashfs + echo 'iso_source -> squashfs' | tee -a "$log_file" else # ERROR echo "No corect AIM in Settings" | tee -a "$log_file" @@ -56,7 +56,7 @@ function check_config() { echo "only Squashfs source in Settings, cant creat ISO" | tee -a "$log_file" return 3 else - # squashfs -> squashfs + echo 'squashfs -> squashfs' | tee -a "$log_file" fi else # ERROR From cee345cd257f26725fe9312479e141ab368c7600 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 23:16:24 +0200 Subject: [PATCH 22/55] fix until name change --- src/proj/desinfect2017 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/proj/desinfect2017 diff --git a/src/proj/desinfect2017 b/src/proj/desinfect2017 new file mode 100644 index 0000000..e69de29 From c0ddfe7c1c2e892fe69cd69822ef493881413b01 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 23:29:33 +0200 Subject: [PATCH 23/55] v 2.0.3 --- DEBIAN/control | 2 +- changes/remaster.md | 4 +++- src/remaster.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DEBIAN/control b/DEBIAN/control index 546040e..132f7d0 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -1,6 +1,6 @@ Package: remaster Source: remaster -Version: 2.0.2-2 +Version: 2.0.3 Architecture: all Maintainer: 6543 <6543@obermui.de> Installed-Size: diff --git a/changes/remaster.md b/changes/remaster.md index d910dfe..d5f582d 100644 --- a/changes/remaster.md +++ b/changes/remaster.md @@ -19,6 +19,8 @@ 2018-05-13 - 2.0.2 * hotfix-2.0.2 ( create release folder if not exist ) -2018-05-20 - 2.0.2-2 +2018-05-20 - 2.0.3 * make email, proxy optional * change Strukture.md + * add config check + * some help scripts diff --git a/src/remaster.sh b/src/remaster.sh index 17b3d2b..391083b 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -1,5 +1,5 @@ #!/bin/bash -#@version 2.0.2-2 +#@version 2.0.3 #@autor 6543@obermui.de #@date 2018-05-20 #@licence GNUv3 From 9301b1a39c0c6ad0a9f928d2ea38d2efd346cf07 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 23:44:26 +0200 Subject: [PATCH 24/55] fix duble report --- src/func/check_config | 39 +++++++++------------------------------ src/func/check_update | 4 ++-- src/remaster.sh | 14 +++++++------- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/func/check_config b/src/func/check_config index 8bed903..fcb70b0 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -2,33 +2,12 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#check_config [log_file] +#check_config function check_config() { - #LOG - { - log_file=$1 - [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" - - if [ -f "$log_file" ]; then - echo > "$log_file" - else - #check if folder exist - [ -d "${log_file%/*}" ] || { - # N-> exit 3 - echo "Directory for Log didnt exist" - exit 3 - } - #create LOG - touch "$log_file" - fi - } - - - #Project [ -f "/proj/$distro" ] || { - echo "No Project \"$distro\" is not supported" | tee -a "$log_file" + echo "No Project \"$distro\" is not supported" return 3 } @@ -38,14 +17,14 @@ function check_config() { #Lable [ -z "$iso_lable" ] && iso_lable="$distro" - echo 'iso_source -> iso_destination' | tee -a "$log_file" - echo 'iso_source -> squashfs [optinal]' | tee -a "$log_file" + echo 'iso_source -> iso_destination' + echo 'iso_source -> squashfs [optinal]' else if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then - echo 'iso_source -> squashfs' | tee -a "$log_file" + echo 'iso_source -> squashfs' else # ERROR - echo "No corect AIM in Settings" | tee -a "$log_file" + echo "No corect AIM in Settings" return 3 fi fi @@ -53,14 +32,14 @@ function check_config() { if [ -f "$filesystem_source" ]; then if [ -n "$iso_destination" ]; then # ERROR - echo "only Squashfs source in Settings, cant creat ISO" | tee -a "$log_file" + echo "only Squashfs source in Settings, cant creat ISO" return 3 else - echo 'squashfs -> squashfs' | tee -a "$log_file" + echo 'squashfs -> squashfs' fi else # ERROR - echo "No corect Source in Settings" | tee -a "$log_file" + echo "No corect Source in Settings" return 3 fi fi diff --git a/src/func/check_update b/src/func/check_update index 7a1847d..79d6d99 100755 --- a/src/func/check_update +++ b/src/func/check_update @@ -5,9 +5,9 @@ #check_update function check_update() { if curl https://raw.githubusercontent.com/6543/remaster/master/changes/remaster.md | diff - <(zcat /usr/share/doc/remaster/changelog.gz ); then - echo 'REMASTER: Aktuell' + echo 'INFO: Programm Aktuell' else - echo 'REMASTER: Warning: neue Version verfügbar' + echo 'WARNUNG: neue Version verfügbar' fi } diff --git a/src/remaster.sh b/src/remaster.sh index 391083b..ddcd498 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -106,10 +106,10 @@ function main_renew() { check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_config "$log_file" + check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_update | tee -a "$log_file" + check_update >> "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -258,12 +258,12 @@ function main_update_pxe() { check_user error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_update | tee -a "$log_file" + check_update >> "$log_file" check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_config "$log_file" + check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -383,12 +383,12 @@ function main_update_iso() { check_user error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_update | tee -a "$log_file" + check_update >> "$log_file" check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_config "$log_file" + check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -503,7 +503,7 @@ function main_update_iso() { ### Error Handlings ### -#check_config [log_file] +#check_config source /func/check_config #on_exit [error_level] From 6076f1372d35cd9d48dab2b8e27c137520ccd695 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 00:16:26 +0200 Subject: [PATCH 25/55] docu ... --- doc/check_config/live-system-files.pdf | Bin 0 -> 17251 bytes doc/check_config/live-system-files.stg | Bin 0 -> 533 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/check_config/live-system-files.pdf create mode 100644 doc/check_config/live-system-files.stg diff --git a/doc/check_config/live-system-files.pdf b/doc/check_config/live-system-files.pdf new file mode 100644 index 0000000000000000000000000000000000000000..334ec1e319dc67a2bcca320ecc356c4260cd1fb1 GIT binary patch literal 17251 zcmZs?1FR@Px1hUi+qP}nwr$%!+qP}n_CDLTZCmf$f97Ux=1scONiEgt?yOE_Rez)k zB4V_RbnLKDq_PU4EOgAUP>ci&1olQ&uuwca^eUbXru4#wE`~Pt=JX1N=BCaB%>UF% z1oX0|E`}!m6acn}11&m>S!gn9|Fb+L^mpFcL5^GqAG# z?-2nbD}lc}LCER;v~b+@O7is%N1ma6&n;^w)pEd99)c`VHkiAL{$)oDRW_AEL3|yd*I(W5%`>S_qbJ9sU%!02Z zXEV7R$LhBQU%1W`a^)5w3tXMnYCa9+U>rz%;JHBXf-i-(Wp4at8>0F*HXmI(TIcZRC6+YD>_v z0qea0@_teNBL2<8)zrk1WlkkvwcRs zBDaTr1k<6adQoWwUJKIZ;?|-+_ZZ*Mc);rhvG0RDu=!%;51dT^Fy&7Y9;a|hb3IdV zAq;Ug`*)^o_im17N2m|&NB!}C857dh0!9INtN*O?2jvE(;0lq?kt4_z)iH#%tN{=P z1bYDW0uScA@pVJrj(R&#M>`?;|LGg^ANw6ngAD3NhKEdafgo&5ry=hnl8;A5kW1`~ z&%*#uni0tmDh;VHLL01RW6~zTG3YhfzJg=}^q4usJ9cyE>PTx}?SSrV&(;aa~N2Q+dmjBkLuHxtw3=+A@0zzn*& z@6`>&&;e&ZHe2ER%gP6&@qv*S#(5c`p5qL!BmtJFh+s#`EXlhrghy0!gz}z&h(T*? zVk5)G98zIu#w4AdGF2oK?V0zU{T|sdtP>b-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p2(rHWn`727NMI`-* zwjnO)+LF5n1G*z?{50joP2Ai%zaB@@8VN*_m5!9t%uKWW0E3FIkN6cM5Vj&U;)Zf( z-H2S!M+b8y{cIpTlJ6bbf5hr=HZ(@O7u|#^b&SRmvzaJ-^}`&{YWm$7jSJ=$M%5v= zN$1z$+W)5K_zG0awy>T=!X8E1n4lR)f-;CF8tWt&+JgXxdY10i2vrHH3e>aWx3)E0$#qq3C&bhgA_Dc zWzi9r_?meUD-{(ly0Rw7xsvU2 zng)$#EB-YitEKEKe5#ag?0n-VD6Wt_)l`Q<(;%^rl8OE)l1Zy>rdBmy)i@Kpk$F71 zs7d(jd5ytp8=704(L)n`-?-k{G1{$)3nqf@P)*&s9PAYc!J#pfUFfX9sfRwh*`9U^ zyH3!Lx;n#X`tJd1Wx7|KV+2} zZ=&0R%aY&#&kZMVY3#kbb=LX!wst*d=IVS+3(56v&3W$kc78#3 z@}$h{(yhEx9vfW_C|c!xwDIGI!%mk^v&bKI75<@d?pCGh2fNMXXZE*Wlbp1$)GGCP z!}_pH<;IC6E%OWAFf)on4KM4IND^ zjEzh!oeT}#oa|ze^FVSEL*xJdGbI|Q7$_^x_;>uk0T!|Jgp^zNZ z)LezM%$(F>h2)IXj4-77r T|Ns93 Date: Mon, 21 May 2018 00:25:27 +0200 Subject: [PATCH 26/55] some name changes --- src/config.sample.cfg | 10 ++-- src/func/check_config | 16 +++--- src/remaster.sh | 130 +++++++++++++++++++++--------------------- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/config.sample.cfg b/src/config.sample.cfg index b16bc57..21fd3e2 100644 --- a/src/config.sample.cfg +++ b/src/config.sample.cfg @@ -8,16 +8,16 @@ modus_default="update_pxe" #CD/DVD -#entweder iso_source oder filesystem_source alls quelle +#entweder iso_source oder squashfs_path 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_aim="/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" +#entweder iso_source oder squashfs_path alls quelle +squashfs_path="/data/remaster/result/filesystem.squashfs" #Network proxy_host="proxy.local" @@ -26,7 +26,7 @@ domain="local" nameserver="10.x.x.2,10.x.x.1" #remaster_script -distro="desinfect2017" +project="desinfect.17" #LOG log_file="/data/remaster/logs/`date '+%Y-%m-%d'`.log" diff --git a/src/func/check_config b/src/func/check_config index fcb70b0..313332a 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -6,21 +6,21 @@ function check_config() { #Project - [ -f "/proj/$distro" ] || { - echo "No Project \"$distro\" is not supported" + [ -f "/proj/$project" ] || { + echo "No Project \"$project\" is not supported" return 3 } #live-system files if [ -f "$iso_source" ]; then - if [ -n "$iso_destination" ] && [ -d "${iso_destination%/*}" ]; then + if [ -n "$iso_aim" ] && [ -d "${iso_aim%/*}" ]; then #Lable - [ -z "$iso_lable" ] && iso_lable="$distro" + [ -z "$iso_lable" ] && iso_lable="$project" - echo 'iso_source -> iso_destination' + echo 'iso_source -> iso_aim' echo 'iso_source -> squashfs [optinal]' else - if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then + if [ -n "$squashfs_path" ] && [ -d "${squashfs_path%/*}" ]; then echo 'iso_source -> squashfs' else # ERROR @@ -29,8 +29,8 @@ function check_config() { fi fi else - if [ -f "$filesystem_source" ]; then - if [ -n "$iso_destination" ]; then + if [ -f "$squashfs_path" ]; then + if [ -n "$iso_aim" ]; then # ERROR echo "only Squashfs source in Settings, cant creat ISO" return 3 diff --git a/src/remaster.sh b/src/remaster.sh index ddcd498..c3d1656 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -63,12 +63,12 @@ function main_renew() { echo "### S e t t i n g s ###" >> "$log_file" echo "#CD/DVD" >> "$log_file" echo "iso_source=\"$iso_source\"" >> "$log_file" - echo "iso_destination=\"$iso_destination\"" >> "$log_file" + echo "iso_aim=\"$iso_aim\"" >> "$log_file" echo "iso_lable=\"$iso_lable\"" >> "$log_file" echo >> "$log_file" echo "#Filesystem (for pxe)" >> "$log_file" - echo "filesystem_source=\"$filesystem_source\"" >> "$log_file" + echo "squashfs_path=\"$squashfs_path\"" >> "$log_file" echo >> "$log_file" echo "#Network" >> "$log_file" @@ -79,7 +79,7 @@ function main_renew() { echo >> "$log_file" echo "#remaster_script" >> "$log_file" - echo "distro=\"$distro\"" >> "$log_file" + echo "project=\"$project\"" >> "$log_file" echo >> "$log_file" echo "log_file=\"$log_file\"" @@ -111,7 +111,7 @@ function main_renew() { check_update >> "$log_file" - [ "$distro" != "" ] && distro="_$distro" + [ "$project" != "" ] && project="_$project" # 2. Entpacke ISO iso_extract "$iso_source" "$iso_extr_dir" @@ -128,12 +128,12 @@ function main_renew() { # 4. Vorbereiten für chroot-Umgebung: - chroot_initial$distro "$chroot_path" >> "$log_file" + chroot_initial$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Setzen der Netzwerk-Einstellungen: [ -n "$proxy_host" ] && { - proxy_enable$distro "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + proxy_enable$project "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } @@ -141,12 +141,12 @@ function main_renew() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 6. Updaten von Desinfec't: - os_update$distro "$chroot_path" >> "$log_file" + os_update$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 7. Installation optionaler Tools: - tools_add$distro "$chroot_path" "$tools_list" >> "$log_file" + tools_add$project "$chroot_path" "$tools_list" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #addo ClamAV to conky_info @@ -169,7 +169,7 @@ function main_renew() { # 9. Umount - Chroot Umgebung auflösen - chroot_umount$distro "$chroot_path" >> "$log_file" + chroot_umount$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #Überprüfen ob alles ausgehängt wurde @@ -186,23 +186,23 @@ function main_renew() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # wenn iso gewünscht - [ "$iso_destination" != "" ] && { - iso_create$distro "$chroot_path" "$iso_extr_dir" "$iso_destination" "$iso_lable" >> "$log_file" + [ "$iso_aim" != "" ] && { + iso_create$project "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } # wenn filesystem gewünscht - [ "$filesystem_source" != "" ] && { + [ "$squashfs_path" != "" ] && { #wen bereits forhanden dann löschen - [ -f "$filesystem_source" ] && rm "$filesystem_source" - cp "$filesystem_img" "$filesystem_source" >> "$log_file" + [ -f "$squashfs_path" ] && rm "$squashfs_path" + cp "$filesystem_img" "$squashfs_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - chmod 666 "$filesystem_source" + chmod 666 "$squashfs_path" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } - chmod 666 "$iso_destination" "$filesystem_img" >> "$log_file" + chmod 666 "$iso_aim" "$filesystem_img" >> "$log_file" workspace_erase "$iso_extr_dir/" "$chroot_path/" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" @@ -226,7 +226,7 @@ function main_update_pxe() { echo "### S e t t i n g s ###" >> "$log_file" echo "#Filesystem (for pxe)" >> "$log_file" - echo "filesystem_source=\"$filesystem_source\"" + echo "squashfs_path=\"$squashfs_path\"" echo >> "$log_file" echo "#Network" >> "$log_file" @@ -235,7 +235,7 @@ function main_update_pxe() { echo >> "$log_file" echo "#remaster_script" >> "$log_file" - echo "distro=\"$distro\"" >> "$log_file" + echo "project=\"$project\"" >> "$log_file" echo >> "$log_file" echo "log_file=\"$log_file\"" @@ -266,20 +266,20 @@ function main_update_pxe() { check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - [ "$distro" != "" ] && distro="_$distro" + [ "$project" != "" ] && project="_$project" # 1. Entpacken der Dateien des Live-Systems - [ -e "$filesystem_source" ] || { - echo "### ERROR ### \"$filesystem_source\" does not exist!" >> "$log_file" + [ -e "$squashfs_path" ] || { + echo "### ERROR ### \"$squashfs_path\" does not exist!" >> "$log_file" on_exit 15 >> "$log_file" } - filesystem_extract "$filesystem_source" "$chroot_path" >> "$log_file" + filesystem_extract "$squashfs_path" "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 2. Vorbereiten für chroot-Umgebung: - chroot_initial$distro "$chroot_path" >> "$log_file" + chroot_initial$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 3. Setzen der Netzwerk-Einstellungen: @@ -288,7 +288,7 @@ function main_update_pxe() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 4. Updaten von Desinfec't: - os_update$distro "$chroot_path" >> "$log_file" + os_update$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Manuelle Aktionen - deaktiviert @@ -301,7 +301,7 @@ function main_update_pxe() { # 6. Umount - Chroot Umgebung auflösen - chroot_umount$distro "$chroot_path" >> "$log_file" + chroot_umount$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #Überprüfen ob alles ausgehängt wurde @@ -311,13 +311,13 @@ function main_update_pxe() { } # 5. Packen und Ersetzen der Dateien - rm "$filesystem_source" >> "$log_file" + rm "$squashfs_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - filesystem_pack "$chroot_path" "$filesystem_source" >> "$log_file" + filesystem_pack "$chroot_path" "$squashfs_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - chmod 777 "$filesystem_source" >> "$log_file" + chmod 777 "$squashfs_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" workspace_erase "$chroot_path/" >> "$log_file" @@ -343,12 +343,12 @@ function main_update_iso() { echo "### S e t t i n g s ###" >> "$log_file" echo "#CD/DVD" >> "$log_file" echo "iso_source=\"$iso_source\"" >> "$log_file" - echo "iso_destination=\"$iso_destination\"" >> "$log_file" + echo "iso_aim=\"$iso_aim\"" >> "$log_file" echo "iso_lable=\"$iso_lable\"" >> "$log_file" echo >> "$log_file" echo "#Filesystem (for pxe)" >> "$log_file" - echo "filesystem_source=\"$filesystem_source\"" >> "$log_file" + echo "squashfs_path=\"$squashfs_path\"" >> "$log_file" echo >> "$log_file" echo "#Network" >> "$log_file" @@ -359,7 +359,7 @@ function main_update_iso() { echo >> "$log_file" echo "#remaster_script" >> "$log_file" - echo "distro=\"$distro\"" >> "$log_file" + echo "project=\"$project\"" >> "$log_file" echo >> "$log_file" echo "log_file=\"$log_file\"" @@ -391,7 +391,7 @@ function main_update_iso() { check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - [ "$distro" != "" ] && distro="_$distro" + [ "$project" != "" ] && project="_$project" # 2. Entpacke ISO iso_extract "$iso_source" "$iso_extr_dir" @@ -418,12 +418,12 @@ function main_update_iso() { # 4. Vorbereiten für chroot-Umgebung: - chroot_initial$distro "$chroot_path" >> "$log_file" + chroot_initial$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Setzen der Netzwerk-Einstellungen: [ -n "$proxy_host" ] && { - proxy_enable$distro "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + proxy_enable$project "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } @@ -431,12 +431,12 @@ function main_update_iso() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 6. Updaten von Desinfec't: - os_update$distro "$chroot_path" >> "$log_file" + os_update$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 7. Installation optionaler Tools: - tools_add$distro "$chroot_path" "$tools_list" >> "$log_file" + tools_add$project "$chroot_path" "$tools_list" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #addo ClamAV to conky_info @@ -454,7 +454,7 @@ function main_update_iso() { # 9. Umount - Chroot Umgebung auflösen - chroot_umount$distro "$chroot_path" >> "$log_file" + chroot_umount$project "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #Überprüfen ob alles ausgehängt wurde @@ -471,23 +471,23 @@ function main_update_iso() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # wenn iso gewünscht - [ "$iso_destination" != "" ] && { - iso_create$distro "$chroot_path" "$iso_extr_dir" "$iso_destination" "$iso_lable" >> "$log_file" + [ "$iso_aim" != "" ] && { + iso_create$project "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } # wenn filesystem gewünscht - [ "$filesystem_source" != "" ] && { + [ "$squashfs_path" != "" ] && { #wen bereits forhanden dann löschen - [ -f "$filesystem_source" ] && rm "$filesystem_source" - cp "$filesystem_img" "$filesystem_source" >> "$log_file" + [ -f "$squashfs_path" ] && rm "$squashfs_path" + cp "$filesystem_img" "$squashfs_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - chmod 666 "$filesystem_source" + chmod 666 "$squashfs_path" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } - chmod 666 "$iso_destination" "$filesystem_img" >> "$log_file" + chmod 666 "$iso_aim" "$filesystem_img" >> "$log_file" #11. End workspace_erase "$iso_extr_dir/" "$chroot_path/" >> "$log_file" @@ -545,16 +545,16 @@ source /func/filesystem_get_type #iso_extract [iso_source] [iso_extr_dir] source /func/iso_extract -#iso_create [chroot_path] [iso_extr_dir] [iso_destination] [iso_lable] +#iso_create [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] source /func/iso_create -#iso_create_desinfect2015 [chroot_path] [iso_extr_dir] [iso_destination] [iso_lable] +#iso_create_desinfect2015 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] function iso_create_desinfect2015() { echo "prepere iso folder ... " chroot_path="$1" iso_extr_dir="$2" - iso_destination="$3" + iso_aim="$3" iso_lable="$4" #desinfect @@ -563,16 +563,16 @@ function iso_create_desinfect2015() { echo "done" - iso_create "$chroot_path" "$iso_extr_dir" "$iso_destination" "$iso_lable" + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" } -#iso_create_desinfect2016 [chroot_path] [iso_extr_dir] [iso_destination] [iso_lable] +#iso_create_desinfect2016 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] function iso_create_desinfect2016() { #echo "prepere iso folder ... " chroot_path="$1" iso_extr_dir="$2" - iso_destination="$3" + iso_aim="$3" iso_lable="$4" #desinfect @@ -581,19 +581,19 @@ function iso_create_desinfect2016() { #echo "done" - iso_create "$chroot_path" "$iso_extr_dir" "$iso_destination" "$iso_lable" + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" } -#iso_create_desinfect2017 [chroot_path] [iso_extr_dir] [iso_destination] [iso_lable] -function iso_create_desinfect2017() { +#iso_create_desinfect.17 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] +function iso_create_desinfect.17() { #echo "prepere iso folder ... " chroot_path="$1" iso_extr_dir="$2" - iso_destination="$3" + iso_aim="$3" iso_lable="$4" - iso_create "$chroot_path" "$iso_extr_dir" "$iso_destination" "$iso_lable" + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" } ### chroot ### @@ -645,8 +645,8 @@ function chroot_initial_desinfect2016() { echo "done" } -#chroot_initial_desinfect2017 [chroot_dir] -function chroot_initial_desinfect2017() { +#chroot_initial_desinfect.17 [chroot_dir] +function chroot_initial_desinfect.17() { #$1 = chroot dir chroot_initial "$1" @@ -707,8 +707,8 @@ function chroot_umount_desinfect2016() { echo "done" } -#chroot_umount_desinfect2017 [chroot_dir] -function chroot_umount_desinfect2017() { +#chroot_umount_desinfect.17 [chroot_dir] +function chroot_umount_desinfect.17() { #call main mount chroot_umount "$1" } @@ -835,8 +835,8 @@ function proxy_enable_desinfect2016() { echo "done" } -#proxy_enable_desinfect2017 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect2017() { +#proxy_enable_desinfect.17 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable_desinfect.17() { proxy_enable $1 $2 $3 @@ -1248,8 +1248,8 @@ function os_update_desinfect2016() { echo "update virus definitions done" } -#os_update_desinfect2017 [chroot_dir] -function os_update_desinfect2017() { +#os_update_desinfect.17 [chroot_dir] +function os_update_desinfect.17() { #$1 = chroot directory chroot_dir="$1" @@ -1370,8 +1370,8 @@ function tools_add_desinfect2016() { sourcelist_desinfect_set_nomal2016 "$chroot_dir" } -#tools_add_desinfect2017 [chroot_dir] [tools_list] -function tools_add_desinfect2017() { +#tools_add_desinfect.17 [chroot_dir] [tools_list] +function tools_add_desinfect.17() { #$1 = chroot directory chroot_dir="$1" tools_list="$2" From 6bc29a5011ea23755b699528b24e2a1ad4bcd009 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 00:46:33 +0200 Subject: [PATCH 27/55] remove tmp-fix --- src/proj/desinfect2017 | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/proj/desinfect2017 diff --git a/src/proj/desinfect2017 b/src/proj/desinfect2017 deleted file mode 100644 index e69de29..0000000 From be32c02a813dcc8814dd563c909c7228383a7ab0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 12:07:47 +0200 Subject: [PATCH 28/55] add some more messages to log --- src/remaster.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/remaster.sh b/src/remaster.sh index c3d1656..20ac88c 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -84,7 +84,7 @@ function main_renew() { echo "log_file=\"$log_file\"" echo "log_mail_aim=\"$log_mail_aim\"" - echo "log_mail_subject=\"$log_mail_subject\"" + echo "log_mail_subject=\"$log_mail_subj >> "$log_file"ect\"" echo "" echo "#Sonstiges" >> "$log_file" @@ -100,10 +100,10 @@ function main_renew() { echo $'### R U N ... ###\n' >> "$log_file" #1. Set and Check Enviroment - check_user + check_user >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_dependency + check_dependency >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" check_config >> "$log_file" @@ -114,7 +114,7 @@ function main_renew() { [ "$project" != "" ] && project="_$project" # 2. Entpacke ISO - iso_extract "$iso_source" "$iso_extr_dir" + iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" # 3. Entpacken der Dateien des Live-Systems filesystem_img="`find "$iso_extr_dir" -name filesystem.squashfs`" @@ -255,12 +255,12 @@ function main_update_pxe() { echo $'### R U N ... ###\n' >> "$log_file" #1. Set and Check Enviroment - check_user + check_user >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" check_update >> "$log_file" - check_dependency + check_dependency >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" check_config >> "$log_file" @@ -380,12 +380,12 @@ function main_update_iso() { echo $'### R U N ... ###\n' >> "$log_file" #1. Set and Check Enviroment - check_user + check_user >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" check_update >> "$log_file" - check_dependency + check_dependency >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" check_config >> "$log_file" @@ -394,7 +394,7 @@ function main_update_iso() { [ "$project" != "" ] && project="_$project" # 2. Entpacke ISO - iso_extract "$iso_source" "$iso_extr_dir" + iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" # 3. Checke pxe version # if pxe is set From 7c46700bd57f990ece58aee91343c7074e983851 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 12:34:55 +0200 Subject: [PATCH 29/55] init --- src/proj/desinfect.15 | 7 +++++++ src/proj/desinfect.16 | 7 +++++++ src/proj/desinfect.17 | 2 -- src/proj/ubuntu.14.04 | 7 +++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 src/proj/desinfect.15 create mode 100755 src/proj/desinfect.16 create mode 100755 src/proj/ubuntu.14.04 diff --git a/src/proj/desinfect.15 b/src/proj/desinfect.15 new file mode 100755 index 0000000..5ffec8c --- /dev/null +++ b/src/proj/desinfect.15 @@ -0,0 +1,7 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +#desinfect.15 +# . -Y ubuntu.14.04 -> ubuntu -> debian +source /proj/ubuntu.14.04 diff --git a/src/proj/desinfect.16 b/src/proj/desinfect.16 new file mode 100755 index 0000000..b4935c5 --- /dev/null +++ b/src/proj/desinfect.16 @@ -0,0 +1,7 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +#desinfect.16 +# . -Y ubuntu.14.04 -> ubuntu -> debian +source /proj/ubuntu.14.04 diff --git a/src/proj/desinfect.17 b/src/proj/desinfect.17 index eedc2ce..d86cd6b 100755 --- a/src/proj/desinfect.17 +++ b/src/proj/desinfect.17 @@ -5,5 +5,3 @@ #desinfect.17 # . -Y ubuntu.16.04 -> ubuntu -> debian source /proj/ubuntu.16.04 - -TEST2="na" diff --git a/src/proj/ubuntu.14.04 b/src/proj/ubuntu.14.04 new file mode 100755 index 0000000..427a76a --- /dev/null +++ b/src/proj/ubuntu.14.04 @@ -0,0 +1,7 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +#ubuntu.16.04 +# . -> ubuntu -> debian +source /proj/ubuntu From e32c217fea98786df197bbc5aabbbe73a327a582 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 12:42:10 +0200 Subject: [PATCH 30/55] generalize project file format --- src/proj/debian | 2 +- src/proj/desinfect.15 | 1 + src/proj/desinfect.16 | 1 + src/proj/desinfect.17 | 1 + src/proj/ubuntu | 1 + src/proj/ubuntu.14.04 | 3 ++- src/proj/ubuntu.16.04 | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/proj/debian b/src/proj/debian index db0aaa4..e0e89ec 100755 --- a/src/proj/debian +++ b/src/proj/debian @@ -6,7 +6,7 @@ ##### Base Template D E B I A N #### #################################### # . - +project_relation="debian" #tools_add [chroot_dir] [tools_list] function tools_add() { diff --git a/src/proj/desinfect.15 b/src/proj/desinfect.15 index 5ffec8c..75d511f 100755 --- a/src/proj/desinfect.15 +++ b/src/proj/desinfect.15 @@ -5,3 +5,4 @@ #desinfect.15 # . -Y ubuntu.14.04 -> ubuntu -> debian source /proj/ubuntu.14.04 +project_relation="desinfect.15 $project_relation" diff --git a/src/proj/desinfect.16 b/src/proj/desinfect.16 index b4935c5..c52d5ff 100755 --- a/src/proj/desinfect.16 +++ b/src/proj/desinfect.16 @@ -5,3 +5,4 @@ #desinfect.16 # . -Y ubuntu.14.04 -> ubuntu -> debian source /proj/ubuntu.14.04 +project_relation="desinfect.16 $project_relation" diff --git a/src/proj/desinfect.17 b/src/proj/desinfect.17 index d86cd6b..b0596f3 100755 --- a/src/proj/desinfect.17 +++ b/src/proj/desinfect.17 @@ -5,3 +5,4 @@ #desinfect.17 # . -Y ubuntu.16.04 -> ubuntu -> debian source /proj/ubuntu.16.04 +project_relation="desinfect.17 $project_relation" diff --git a/src/proj/ubuntu b/src/proj/ubuntu index cd36ae9..8f00d9f 100755 --- a/src/proj/ubuntu +++ b/src/proj/ubuntu @@ -7,3 +7,4 @@ #################################### # . -> debian source /proj/debian +project_relation="ubuntu $project_relation" diff --git a/src/proj/ubuntu.14.04 b/src/proj/ubuntu.14.04 index 427a76a..d535285 100755 --- a/src/proj/ubuntu.14.04 +++ b/src/proj/ubuntu.14.04 @@ -2,6 +2,7 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#ubuntu.16.04 +#ubuntu.14.04 # . -> ubuntu -> debian source /proj/ubuntu +project_relation="ubuntu.14.04 $project_relation" diff --git a/src/proj/ubuntu.16.04 b/src/proj/ubuntu.16.04 index 427a76a..3143508 100755 --- a/src/proj/ubuntu.16.04 +++ b/src/proj/ubuntu.16.04 @@ -5,3 +5,4 @@ #ubuntu.16.04 # . -> ubuntu -> debian source /proj/ubuntu +project_relation="ubuntu.16.04 $project_relation" From 636aba43d5c7cdbb15a0a65bb7fbbfe39c884258 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 12:45:42 +0200 Subject: [PATCH 31/55] docu ... --- doc/proj-head | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 doc/proj-head diff --git a/doc/proj-head b/doc/proj-head new file mode 100755 index 0000000..2b70ea3 --- /dev/null +++ b/doc/proj-head @@ -0,0 +1,8 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +# +# . -> -> +source /proj/ +project_relation=" $project_relation" From 0ffbae48a7a44275edc78b222020d1e030089e3e Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 13:04:37 +0200 Subject: [PATCH 32/55] =?UTF-8?q?das=20gro=C3=9Fe=20wandern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/proj/debian | 53 +++ src/proj/desinfect.15 | 213 +++++++++++ src/proj/desinfect.16 | 268 ++++++++++++++ src/proj/desinfect.17 | 267 ++++++++++++++ src/remaster.sh | 815 ------------------------------------------ 5 files changed, 801 insertions(+), 815 deletions(-) diff --git a/src/proj/debian b/src/proj/debian index e0e89ec..3ac9a45 100755 --- a/src/proj/debian +++ b/src/proj/debian @@ -35,3 +35,56 @@ function os_update() { echo "done" } + +#proxy_enable [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable() { + echo -n "enable proxy ... " + + chroot_dir="$1" + proxy_host="$2" + proxy_port="$3" + + [ -d "$chroot_dir" ] || { + echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" + return 12 + } + + #Wenn alle zwei Parameter gegeben + if [ "$proxy_host" != "" ] && [ "$proxy_port" != "" ] ; then + echo "http_proxy=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment + echo "https_proxy=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment + echo "ftp_proxy=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment + + echo "HTTP_PROXY=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment + echo "HTTPS_PROXY=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment + echo "FTP_PROXY=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment + + echo "Acquire::http::Proxy \"http://$proxy_host:$proxy_port\"\;" > $chroot_dir/etc/apt/apt.conf.d/90proxy + echo "Acquire::ftp::Proxy \"ftp://$proxy_host:$proxy_port\"\;" >> $chroot_dir/etc/apt/apt.conf.d/90proxy + + echo "done" + else + if [ "$proxy_host" == "" ] && [ "$proxy_port" == "" ] ; then + echo "done" + else + echo "### ERROR ### proxy_enable: wrong parameters! (\"$chroot_dir\"; \"$proxy_host\"; \"$proxy_port\")" + echo "proxy_enable [chroot_dir] [proxy_host] [proxy_port]" + return 2 + fi + fi +} + +#dns_set [chroot_dir] [domain] [nameserver] +function dns_set() { + echo -n "set dns config ... " + + rm "$chroot_dir/etc/resolv.conf" + + [ "$2" != "" ] && echo "domain $2" >> "$chroot_dir/etc/resolv.conf" + echo "search $2" >> "$chroot_dir/etc/resolv.conf" + for namesv in `echo "$3" | tr "," " "`; do + echo "nameserver $namesv" >> "$chroot_dir/etc/resolv.conf" + done + + echo "done" +} diff --git a/src/proj/desinfect.15 b/src/proj/desinfect.15 index 75d511f..7639578 100755 --- a/src/proj/desinfect.15 +++ b/src/proj/desinfect.15 @@ -6,3 +6,216 @@ # . -Y ubuntu.14.04 -> ubuntu -> debian source /proj/ubuntu.14.04 project_relation="desinfect.15 $project_relation" + + + +#iso_create_desinfect2015 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] +function iso_create_desinfect2015() { + echo "prepere iso folder ... " + + chroot_path="$1" + iso_extr_dir="$2" + iso_aim="$3" + iso_lable="$4" + + #desinfect + rm "$iso_extr_dir/casper/initrd.lz" + wget http://www.heise.de/ct/projekte/desinfect/des15/initrd.lz -O "$iso_extr_dir/casper/initrd.lz" + + echo "done" + + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" +} + +#chroot_initial_desinfect2015 [chroot_dir] +function chroot_initial_desinfect2015() { + #$1 = chroot dir + + chroot_initial "$1" + + echo -n "initial desinfect on chroot ... " + + #check chroot dir + chroot_dir="$1" + [ -d "$chroot_dir" ] || { + echo "### ERROR ### chroot_initial_desinfect: chroot directory not exist!" + return 12 + } + + #mount virus definitions + #bitdefender + mount --bind $chroot_dir/opt/BitDefender-scanner/var/lib/scan{.orig,} + mount --bind $chroot_dir/var/kl/bases_rd{.orig,} + + echo "done" +} + +#chroot_umount_desinfect2015 [chroot_dir] +function chroot_umount_desinfect2015() { + #call main mount + chroot_umount "$1" + + echo -n "unmount desinfect on chroot ... " + #check chroot dir + chroot_dir="$1" + [ -d "$chroot_dir" ] || { + echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" + return 12 + } + + for d in "$chroot_dir/opt/BitDefender-scanner/var/lib/scan" "$chroot_dir/var/kl/bases_rd" ; do + umount $d + retval=$? + [ "$retval" -gt 0 ] && { + echo "### ERROR ### chroot_umount_desinfect: can't umount \"$d\"!" + return 21 + } + done + + echo "done" +} + +#proxy_enable_desinfect2015 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable_desinfect2015() { + + proxy_enable $1 $2 $3 + + echo -n "enable proxy for desinfect's av ... " + + chroot_dir="$1" + proxy_host="$2" + proxy_port="$3" + + #Avast AntiVirus + sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" + sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" + + #BitDefender + echo "ProxyEnable = Yes" >> "$chroot_dir/etc/BitDefender-scanner/bdscan.conf" + echo "ProxyHost = $proxy_host:$proxy_port" >> "$chroot_dir/etc/BitDefender-scanner/bdscan.conf" + + #Clam AV + echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" + echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" + + #Kaspersky + sed -i "s/0<\/tDWORD>/1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" + sed -i "s/<\/tSTRING>/$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml" + sed -i "s/<\/tDWORD>/$proxy_port<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" + + echo "done" +} + +#sourcelist_desinfect_set_nomal2015 [chroot_dir] +function sourcelist_desinfect_set_nomal2015() { + echo -n "build normal source.list ... " + #$1 = chroot directory + + sourcelist="$1/etc/apt/sources.list" + + + echo "#### Desinfe't 2015 ####" > "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2015 main" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "# #### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" + echo "# ## developers who want to ship their latest software." >> "$sourcelist" + echo "# deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" + + echo "done" +} + +#sourcelist_desinfect_set_extendet2015 [chroot_dir] +function sourcelist_desinfect_set_extendet2015() { + echo -n "build extendet source.list ... " + + sourcelist="$1/etc/apt/sources.list" + + + echo "#### Desinfe't 2015 ####" > "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2015 main" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "#### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" + echo "## developers who want to ship their latest software." >> "$sourcelist" + echo "deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" + + echo "done" +} + +#os_update_desinfect2015 [chroot_dir] +function os_update_desinfect2015() { + #$1 = chroot directory + + chroot_dir="$1" + + #call main os_update + os_update "$chroot_dir" + + echo "update virus definitions ... " + + #BitDefender + chroot "$chroot_dir" /bin/bash -c "bdscan --update" | grep -v "... updated" + + #Avast Avira + chroot "$chroot_dir" /bin/bash -c "/AntiVirUpdate/avupdate" | grep -v " -> " + + #Clam AV + chroot "$chroot_dir" /bin/bash -c "freshclam" > /dev/null + rm -f "$chroot_dir/var/lib/clamav/daily.cld" + + #Karspersky + echo '#!/bin/bash' > "$chroot_dir/tmp/up_kasp" + echo 'PATH=/usr/lib/kl:$PATH' >> "$chroot_dir/tmp/up_kasp" + echo 'LD_LIBRARY_PATH=/usr/lib/kl:$LD_LIBRARY_PATH' >> "$chroot_dir/tmp/up_kasp" + echo 'KL_PLUGINS_PATH=/usr/lib/kl' >> "$chroot_dir/tmp/up_kasp" + echo 'export PATH LD_LIBRARY_PATH KL_PLUGINS_PATH' >> "$chroot_dir/tmp/up_kasp" + echo '/usr/lib/kl/kav update' >> "$chroot_dir/tmp/up_kasp" + chmod +x "$chroot_dir/tmp/up_kasp" + chroot "$chroot_dir" /bin/bash -c "/tmp/up_kasp" | grep -v ".kdc" | grep -v "File downloaded" + rm "$chroot_dir/tmp/up_kasp" + + + echo "done" +} + +#tools_add_desinfect2015 [chroot_dir] [tools_list] +function tools_add_desinfect2015() { + #$1 = chroot directory + chroot_dir="$1" + tools_list="$2" + + sourcelist_desinfect_set_extendet2015 "$chroot_dir" + tools_add "$chroot_dir" "$tools_list" + sourcelist_desinfect_set_nomal2015 "$chroot_dir" +} diff --git a/src/proj/desinfect.16 b/src/proj/desinfect.16 index c52d5ff..9c8246d 100755 --- a/src/proj/desinfect.16 +++ b/src/proj/desinfect.16 @@ -6,3 +6,271 @@ # . -Y ubuntu.14.04 -> ubuntu -> debian source /proj/ubuntu.14.04 project_relation="desinfect.16 $project_relation" + + + +#iso_create_desinfect2016 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] +function iso_create_desinfect2016() { + #echo "prepere iso folder ... " + + chroot_path="$1" + iso_extr_dir="$2" + iso_aim="$3" + iso_lable="$4" + + #desinfect + #rm "$iso_extr_dir/casper/initrd.lz" + #wget http://www.heise.de/ct/projekte/desinfect/des15/initrd.lz -O "$iso_extr_dir/casper/initrd.lz" + + #echo "done" + + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" +} + +#chroot_initial_desinfect2016 [chroot_dir] +function chroot_initial_desinfect2016() { + #$1 = chroot dir + + chroot_initial "$1" + + echo -n "initial desinfect on chroot ... " + + #check chroot dir + chroot_dir="$1" + [ -d "$chroot_dir" ] || { + echo "### ERROR ### chroot_initial_desinfect: chroot directory not exist!" + return 12 + } + + #mount virus definitions + mount --bind $chroot_dir/var/kl/bases_rd{.orig,} + + echo "done" +} + +#chroot_umount_desinfect2016 [chroot_dir] +function chroot_umount_desinfect2016() { + #call main mount + chroot_umount "$1" + + echo -n "unmount desinfect on chroot ... " + #check chroot dir + chroot_dir="$1" + [ -d "$chroot_dir" ] || { + echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" + return 12 + } + + umount "$chroot_dir/var/kl/bases_rd" + [ "$?" -gt 0 ] && { + echo "### ERROR ### chroot_umount_desinfect: can't umount \"$chroot_dir/var/kl/bases_rd\"!" + #return 21 + } + + echo "done" +} + +#proxy_enable_desinfect2016 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable_desinfect2016() { + + proxy_enable $1 $2 $3 + + echo -n "enable proxy for desinfect's av ... " + + chroot_dir="$1" + proxy_host="$2" + proxy_port="$3" + tmp_file_344532="`mktemp`" + + #Avast AntiVirus + sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" + sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" + + #Clam AV + cat "$chroot_dir/etc/clamav/freshclam.conf" | grep -v "HTTPProxyServer" | grep -v "HTTPProxyPort" > "$tmp_file_344532" + rm "$chroot_dir/etc/clamav/freshclam.conf" + cp "$tmp_file_344532" "$chroot_dir/etc/clamav/freshclam.conf" + + echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" + echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" + + #Eset AV + cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "proxy_addr" | grep -v "proxy_port" > "$tmp_file_344532" + rm "$chroot_dir/etc/opt/eset/esets/esets.cfg" + cp "$tmp_file_344532" "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + echo "proxy_addr = \"$proxy_host\"" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" + echo "proxy_port = $proxy_port" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + #Kaspersky + sed -i "s/0<\/tDWORD>/1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" + sed -i "s/<\/tSTRING>/$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml" + sed -i "s/<\/tDWORD>/$proxy_port<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" + + rm "$tmp_file_344532" + tmp_file_344532= + + echo "done" +} + +#sourcelist_desinfect_set_nomal2016 [chroot_dir] +function sourcelist_desinfect_set_nomal2016() { + echo -n "build normal source.list ... " + #$1 = chroot directory + + sourcelist="$1/etc/apt/sources.list" + + + echo "#### Desinfe't 2016 ####" > "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2016 main" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "# #### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" + echo "# ## developers who want to ship their latest software." >> "$sourcelist" + echo "# deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" + + echo "done" +} + +#sourcelist_desinfect_set_extendet2016 [chroot_dir] +function sourcelist_desinfect_set_extendet2016() { + echo -n "build extendet source.list ... " + + sourcelist="$1/etc/apt/sources.list" + + + echo "#### Desinfe't 2016 ####" > "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2016 main" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "#### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" + echo "## developers who want to ship their latest software." >> "$sourcelist" + echo "deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" + + echo "done" +} + +#os_update_desinfect2016 [chroot_dir] +function os_update_desinfect2016() { + #$1 = chroot directory + + chroot_dir="$1" + + #call main os_update + os_update "$chroot_dir" + + echo "update virus definitions ... " + + #Avast Avira + { + echo "Avira ..." + chroot "$chroot_dir" /bin/bash -c "/AntiVirUpdate/avupdate" | grep -v " -> " + echo "Avira done" + } + + #Clam AV + { + echo "ClamAV..." + chroot "$chroot_dir" /bin/bash -c "freshclam" > /dev/null + rm -f "$chroot_dir/var/lib/clamav/daily.cld" + echo "ClamAV done" + } + + #Eset AV + { + echo "Eset AV ..." + tmp_file_23421="`mktemp`" + cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "av_update_username" | grep -v "av_update_password" > "$tmp_file_23421" + cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" + chroot "$chroot_dir" /bin/bash -c "/usr/bin/esetrand" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + echo "set timeout: 2min" + av_eaet_timeout=1200 + tmp_var_3092="`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" + + #eig. update routine + chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets restart" + sleep 2 + chroot "$chroot_dir" /bin/bash -c "/opt/eset/esets/sbin/esets_daemon --update" + + #warten auf daemon update ... + sleep 10m + echo "wait 10min for Eset AV update" + while [ "`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" == "$tmp_var_3092" ]; do + sleep 1 + av_eaet_timeout=$((av_eaet_timeout-1)) + [ $av_eaet_timeout -gt 0 ] || tmp_var_3092= + done + + sleep 4 + + chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets stop" + + cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + rm "$tmp_file_23421" + tmp_file_23421= + tmp_var_3092= + echo "Eset AV done" + } + + #Karspersky + { + echo "Karspersky ..." + #gen update-scrypt + echo '#!/bin/bash' > "$chroot_dir/tmp/up_kasp" + echo 'PATH=/usr/lib/kl:$PATH' >> "$chroot_dir/tmp/up_kasp" + echo 'LD_LIBRARY_PATH=/usr/lib/kl:$LD_LIBRARY_PATH' >> "$chroot_dir/tmp/up_kasp" + echo 'KL_PLUGINS_PATH=/usr/lib/kl' >> "$chroot_dir/tmp/up_kasp" + echo 'export PATH LD_LIBRARY_PATH KL_PLUGINS_PATH' >> "$chroot_dir/tmp/up_kasp" + echo '/usr/lib/kl/kav update' >> "$chroot_dir/tmp/up_kasp" + chmod +x "$chroot_dir/tmp/up_kasp" + + chroot "$chroot_dir" /bin/bash -c "/tmp/up_kasp" | grep -v ".kdc" | grep -v "File downloaded" + rm "$chroot_dir/tmp/up_kasp" + echo "Karspersky done" + } + + echo "update virus definitions done" +} + +#tools_add_desinfect2016 [chroot_dir] [tools_list] +function tools_add_desinfect2016() { + #$1 = chroot directory + chroot_dir="$1" + tools_list="$2" + + sourcelist_desinfect_set_extendet2016 "$chroot_dir" + tools_add "$chroot_dir" "$tools_list" + sourcelist_desinfect_set_nomal2016 "$chroot_dir" +} diff --git a/src/proj/desinfect.17 b/src/proj/desinfect.17 index b0596f3..6f6d334 100755 --- a/src/proj/desinfect.17 +++ b/src/proj/desinfect.17 @@ -6,3 +6,270 @@ # . -Y ubuntu.16.04 -> ubuntu -> debian source /proj/ubuntu.16.04 project_relation="desinfect.17 $project_relation" + + +#sourcelist_desinfect_set_nomal2017 [chroot_dir] +function sourcelist_desinfect_set_nomal2017() { + echo -n "build normal source.list ... " + #$1 = chroot directory + + sourcelist="$1/etc/apt/sources.list" + + + echo "#### Desinfe't 2017 ####" > "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2017 main" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "# #### Ubuntu 16.04 LTS (Xenial) ####" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" + echo "# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" + echo "#" >> "$sourcelist" + echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" + echo "# ## developers who want to ship their latest software." >> "$sourcelist" + echo "# deb http://extras.ubuntu.com/ubuntu xenial main" >> "$sourcelist" + + echo "done" +} + +#sourcelist_desinfect_set_extendet2017 [chroot_dir] +function sourcelist_desinfect_set_extendet2017() { + echo -n "build extendet source.list ... " + + sourcelist="$1/etc/apt/sources.list" + + + echo "#### Desinfe't 2017 ####" > "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2017 main" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "#### Ubuntu 16.04 LTS (Xenial) ####" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" + echo "deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" + echo "" >> "$sourcelist" + echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" + echo "## developers who want to ship their latest software." >> "$sourcelist" + echo "deb http://extras.ubuntu.com/ubuntu xenial main" >> "$sourcelist" + + echo "done" +} + +#os_update_desinfect.17 [chroot_dir] +function os_update_desinfect.17() { + #$1 = chroot directory + + chroot_dir="$1" + + #call main os_update + os_update "$chroot_dir" + + echo "update virus definitions ... " + + #Avast Avira + { + echo "Avira ..." + #chroot "$chroot_dir" /bin/bash --login -c ". /tmp/env.sh; /AntiVirUpdate/avupdate" | grep -v " -> " + chroot_sh "$chroot_dir" "/AntiVirUpdate/avupdate" | grep -v " -> " + echo "Avira done" + } + + #Clam AV + { + echo "ClamAV..." + #chroot "$chroot_dir" /bin/bash --login -c ". /tmp/env.sh; freshclam" > /dev/null + chroot_sh "$chroot_dir" "freshclam" > /dev/null + rm -f "$chroot_dir/var/lib/clamav/daily.cld" + echo "ClamAV done" + } + + #Eset AV + { + echo "Eset AV ..." + tmp_file_23421="`mktemp`" + cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "av_update_username" | grep -v "av_update_password" > "$tmp_file_23421" + cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" + chroot "$chroot_dir" /bin/bash -c "/usr/bin/esetrand" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + av_eaet_timeout=300 + echo "set timeout: $((av_eaet_timeout/60))min" + tmp_var_3092="`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" + + #eig. update routine + #chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets restart" + chroot_sh "$chroot_dir" "/etc/init.d/esets restart" + sleep 2 + #chroot "$chroot_dir" /bin/bash --login -c "/opt/eset/esets/sbin/esets_daemon --update" + chroot_sh "$chroot_dir" "/opt/eset/esets/sbin/esets_daemon --update" + + #warten auf daemon update ... + echo "wait $((av_eaet_timeout/60))min for Eset AV update" + while [ "`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" == "$tmp_var_3092" ]; do + sleep 10 + av_eaet_timeout=$((av_eaet_timeout-10)) + [ $av_eaet_timeout -gt 0 ] || tmp_var_3092= + done + + sleep 4 + + #chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets stop" + chroot_sh "$chroot_dir" "/etc/init.d/esets stop" + + cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + rm "$tmp_file_23421" + tmp_file_23421= + tmp_var_3092= + echo "Eset AV done" + } + + #Sophos + { + echo "Sophos..." + #chroot "$chroot_dir" /bin/bash --login -c "/opt/sophos-av/bin/savupdate -v3" + chroot_sh "$chroot_dir" "/opt/sophos-av/bin/savupdate -v3" + chroot_sh "$chroot_dir" "/opt/sophos-av/bin/savdstatus --version" + #chroot "$chroot_dir" /bin/bash -c "/opt/sophos-av/bin/savupdate -v3 -a" + echo "Sophos done" + } + + #F-Secure + { + echo "F-Secure..." + chroot_sh "$chroot_dir" "/etc/init.d/fsaua start" + chroot_sh "$chroot_dir" "/etc/init.d/fsupdate stop" + ( sleep 1m; chroot_sh "$chroot_dir" "/etc/init.d/fsaua start" ) & + chroot_sh "$chroot_dir" "/opt/f-secure/fssp/bin/dbupdate_lite" && echo "Update Success" + sleep 1m + chroot_sh "$chroot_dir" "/etc/init.d/fsaua stop" + chroot_sh "$chroot_dir" "/etc/init.d/fsupdate stop" + echo "F-Secure done" + } + + echo "update virus definitions done" +} + +#iso_create_desinfect.17 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] +function iso_create_desinfect.17() { + #echo "prepere iso folder ... " + + chroot_path="$1" + iso_extr_dir="$2" + iso_aim="$3" + iso_lable="$4" + + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" +} + +#chroot_initial_desinfect.17 [chroot_dir] +function chroot_initial_desinfect.17() { + #$1 = chroot dir + + chroot_initial "$1" + +} + +#chroot_umount_desinfect.17 [chroot_dir] +function chroot_umount_desinfect.17() { + #call main mount + chroot_umount "$1" +} + +#proxy_enable_desinfect.17 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable_desinfect.17() { + + proxy_enable $1 $2 $3 + + echo "enable proxy for desinfect's av ... " + + chroot_dir="$1" + proxy_host="$2" + proxy_port="$3" + tmp_file_344532="`mktemp`" + + #Avast AntiVirus + if [ -f "$chroot_dir/AntiVirUpdate/avupdate" ]; then + echo "Avast AntiVirus: Found" + sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" + sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" + else + eco "Avast AntiVirus: NOT Found" + fi + + #Eset AV + if [ -f "$chroot_dir/etc/opt/eset/esets/esets.cfg" ]; then + echo "Eset AV: Found" + cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "proxy_addr" | grep -v "proxy_port" > "$tmp_file_344532" + rm "$chroot_dir/etc/opt/eset/esets/esets.cfg" + cp "$tmp_file_344532" "$chroot_dir/etc/opt/eset/esets/esets.cfg" + + echo "proxy_addr = \"$proxy_host\"" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" + echo "proxy_port = $proxy_port" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" + else + eco "Eset AV: NOT Found" + fi + + #ClamAV + if [ -f "$chroot_dir/etc/clamav/freshclam.conf" ]; then + echo "ClamAV: Found" + cat "$chroot_dir/etc/clamav/freshclam.conf" | grep -v "HTTPProxyServer" | grep -v "HTTPProxyPort" > "$tmp_file_344532" + rm "$chroot_dir/etc/clamav/freshclam.conf" + cp "$tmp_file_344532" "$chroot_dir/etc/clamav/freshclam.conf" + + echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" + echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" + else + eco "ClamAV: NOT Found" + fi + + #Sophos + if [ -f ""$chroot_dir/opt/sophos-av/etc/savd.cfg"" ]; then + echo "Sophos: Found" + echo "sophos:
http://$proxy_host:$proxy_port
" >> "$chroot_dir/opt/sophos-av/etc/savd.cfg" + else + eco "Sophos: NOT Found" + fi + + #F-Secure + if [ -f "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" ]; then + echo "F-Secure: Found" + echo "enable_fsma=no" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" + echo "update_servers=http://fsbwserver-direct.f-secure.com" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" + echo "update_proxies=http://$proxy_host:$proxy_port" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" + echo "http_proxies=http://$proxy_host:$proxy_port" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" + cat "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" > "$chroot_dir/etc/opt/f-secure/fsaua/fsaua_config" + else + eco "F-Secure: NOT Found" + fi + + + rm "$tmp_file_344532" + tmp_file_344532= + + echo "done" +} + +#tools_add_desinfect.17 [chroot_dir] [tools_list] +function tools_add_desinfect.17() { + #$1 = chroot directory + chroot_dir="$1" + tools_list="$2" + + sourcelist_desinfect_set_extendet2017 "$chroot_dir" + tools_add "$chroot_dir" "$tools_list" + sourcelist_desinfect_set_nomal2017 "$chroot_dir" +} diff --git a/src/remaster.sh b/src/remaster.sh index 20ac88c..d6060d2 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -548,171 +548,17 @@ source /func/iso_extract #iso_create [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] source /func/iso_create -#iso_create_desinfect2015 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create_desinfect2015() { - echo "prepere iso folder ... " - - chroot_path="$1" - iso_extr_dir="$2" - iso_aim="$3" - iso_lable="$4" - - #desinfect - rm "$iso_extr_dir/casper/initrd.lz" - wget http://www.heise.de/ct/projekte/desinfect/des15/initrd.lz -O "$iso_extr_dir/casper/initrd.lz" - - echo "done" - - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" -} - -#iso_create_desinfect2016 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create_desinfect2016() { - #echo "prepere iso folder ... " - - chroot_path="$1" - iso_extr_dir="$2" - iso_aim="$3" - iso_lable="$4" - - #desinfect - #rm "$iso_extr_dir/casper/initrd.lz" - #wget http://www.heise.de/ct/projekte/desinfect/des15/initrd.lz -O "$iso_extr_dir/casper/initrd.lz" - - #echo "done" - - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" -} - -#iso_create_desinfect.17 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create_desinfect.17() { - #echo "prepere iso folder ... " - - chroot_path="$1" - iso_extr_dir="$2" - iso_aim="$3" - iso_lable="$4" - - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" -} - ### chroot ### #chroot_initial [chroot_dir] source /func/chroot_initial -#chroot_initial_desinfect2015 [chroot_dir] -function chroot_initial_desinfect2015() { - #$1 = chroot dir - - chroot_initial "$1" - - echo -n "initial desinfect on chroot ... " - - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_initial_desinfect: chroot directory not exist!" - return 12 - } - - #mount virus definitions - #bitdefender - mount --bind $chroot_dir/opt/BitDefender-scanner/var/lib/scan{.orig,} - mount --bind $chroot_dir/var/kl/bases_rd{.orig,} - - echo "done" -} - -#chroot_initial_desinfect2016 [chroot_dir] -function chroot_initial_desinfect2016() { - #$1 = chroot dir - - chroot_initial "$1" - - echo -n "initial desinfect on chroot ... " - - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_initial_desinfect: chroot directory not exist!" - return 12 - } - - #mount virus definitions - mount --bind $chroot_dir/var/kl/bases_rd{.orig,} - - echo "done" -} - -#chroot_initial_desinfect.17 [chroot_dir] -function chroot_initial_desinfect.17() { - #$1 = chroot dir - - chroot_initial "$1" - -} - - #chroot_clean [chroot_dir] source /func/chroot_clean #chroot_umount [chroot_dir] source /func/chroot_umount -#chroot_umount_desinfect2015 [chroot_dir] -function chroot_umount_desinfect2015() { - #call main mount - chroot_umount "$1" - - echo -n "unmount desinfect on chroot ... " - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" - return 12 - } - - for d in "$chroot_dir/opt/BitDefender-scanner/var/lib/scan" "$chroot_dir/var/kl/bases_rd" ; do - umount $d - retval=$? - [ "$retval" -gt 0 ] && { - echo "### ERROR ### chroot_umount_desinfect: can't umount \"$d\"!" - return 21 - } - done - - echo "done" -} - -#chroot_umount_desinfect2016 [chroot_dir] -function chroot_umount_desinfect2016() { - #call main mount - chroot_umount "$1" - - echo -n "unmount desinfect on chroot ... " - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" - return 12 - } - - umount "$chroot_dir/var/kl/bases_rd" - [ "$?" -gt 0 ] && { - echo "### ERROR ### chroot_umount_desinfect: can't umount \"$chroot_dir/var/kl/bases_rd\"!" - #return 21 - } - - echo "done" -} - -#chroot_umount_desinfect.17 [chroot_dir] -function chroot_umount_desinfect.17() { - #call main mount - chroot_umount "$1" -} - #chroot_is_mounted [chroot_dir] #(Boolean)-> true | false source /func/chroot_is_mounted @@ -720,667 +566,6 @@ source /func/chroot_is_mounted #chroot_sh [chroot_dir] [command] source /func/chroot_sh -### Settings ### -### proxy - -#proxy_enable [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable() { - echo -n "enable proxy ... " - - chroot_dir="$1" - proxy_host="$2" - proxy_port="$3" - - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" - return 12 - } - - #Wenn alle zwei Parameter gegeben - if [ "$proxy_host" != "" ] && [ "$proxy_port" != "" ] ; then - echo "http_proxy=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment - echo "https_proxy=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment - echo "ftp_proxy=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment - - echo "HTTP_PROXY=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment - echo "HTTPS_PROXY=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment - echo "FTP_PROXY=\"http://$proxy_host:$proxy_port\"" >> $chroot_dir/etc/environment - - echo "Acquire::http::Proxy \"http://$proxy_host:$proxy_port\"\;" > $chroot_dir/etc/apt/apt.conf.d/90proxy - echo "Acquire::ftp::Proxy \"ftp://$proxy_host:$proxy_port\"\;" >> $chroot_dir/etc/apt/apt.conf.d/90proxy - - echo "done" - else - if [ "$proxy_host" == "" ] && [ "$proxy_port" == "" ] ; then - echo "done" - else - echo "### ERROR ### proxy_enable: wrong parameters! (\"$chroot_dir\"; \"$proxy_host\"; \"$proxy_port\")" - echo "proxy_enable [chroot_dir] [proxy_host] [proxy_port]" - return 2 - fi - fi -} - -#proxy_enable_desinfect2015 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect2015() { - - proxy_enable $1 $2 $3 - - echo -n "enable proxy for desinfect's av ... " - - chroot_dir="$1" - proxy_host="$2" - proxy_port="$3" - - #Avast AntiVirus - sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - - #BitDefender - echo "ProxyEnable = Yes" >> "$chroot_dir/etc/BitDefender-scanner/bdscan.conf" - echo "ProxyHost = $proxy_host:$proxy_port" >> "$chroot_dir/etc/BitDefender-scanner/bdscan.conf" - - #Clam AV - echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" - echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" - - #Kaspersky - sed -i "s/0<\/tDWORD>/1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tSTRING>/$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tDWORD>/$proxy_port<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - - echo "done" -} - -#proxy_enable_desinfect2016 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect2016() { - - proxy_enable $1 $2 $3 - - echo -n "enable proxy for desinfect's av ... " - - chroot_dir="$1" - proxy_host="$2" - proxy_port="$3" - tmp_file_344532="`mktemp`" - - #Avast AntiVirus - sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - - #Clam AV - cat "$chroot_dir/etc/clamav/freshclam.conf" | grep -v "HTTPProxyServer" | grep -v "HTTPProxyPort" > "$tmp_file_344532" - rm "$chroot_dir/etc/clamav/freshclam.conf" - cp "$tmp_file_344532" "$chroot_dir/etc/clamav/freshclam.conf" - - echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" - echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" - - #Eset AV - cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "proxy_addr" | grep -v "proxy_port" > "$tmp_file_344532" - rm "$chroot_dir/etc/opt/eset/esets/esets.cfg" - cp "$tmp_file_344532" "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - echo "proxy_addr = \"$proxy_host\"" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - echo "proxy_port = $proxy_port" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - #Kaspersky - sed -i "s/0<\/tDWORD>/1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tSTRING>/$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tDWORD>/$proxy_port<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - - rm "$tmp_file_344532" - tmp_file_344532= - - echo "done" -} - -#proxy_enable_desinfect.17 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect.17() { - - proxy_enable $1 $2 $3 - - echo "enable proxy for desinfect's av ... " - - chroot_dir="$1" - proxy_host="$2" - proxy_port="$3" - tmp_file_344532="`mktemp`" - - #Avast AntiVirus - if [ -f "$chroot_dir/AntiVirUpdate/avupdate" ]; then - echo "Avast AntiVirus: Found" - sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - else - eco "Avast AntiVirus: NOT Found" - fi - - #Eset AV - if [ -f "$chroot_dir/etc/opt/eset/esets/esets.cfg" ]; then - echo "Eset AV: Found" - cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "proxy_addr" | grep -v "proxy_port" > "$tmp_file_344532" - rm "$chroot_dir/etc/opt/eset/esets/esets.cfg" - cp "$tmp_file_344532" "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - echo "proxy_addr = \"$proxy_host\"" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - echo "proxy_port = $proxy_port" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - else - eco "Eset AV: NOT Found" - fi - - #ClamAV - if [ -f "$chroot_dir/etc/clamav/freshclam.conf" ]; then - echo "ClamAV: Found" - cat "$chroot_dir/etc/clamav/freshclam.conf" | grep -v "HTTPProxyServer" | grep -v "HTTPProxyPort" > "$tmp_file_344532" - rm "$chroot_dir/etc/clamav/freshclam.conf" - cp "$tmp_file_344532" "$chroot_dir/etc/clamav/freshclam.conf" - - echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" - echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" - else - eco "ClamAV: NOT Found" - fi - - #Sophos - if [ -f ""$chroot_dir/opt/sophos-av/etc/savd.cfg"" ]; then - echo "Sophos: Found" - echo "sophos:
http://$proxy_host:$proxy_port
" >> "$chroot_dir/opt/sophos-av/etc/savd.cfg" - else - eco "Sophos: NOT Found" - fi - - #F-Secure - if [ -f "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" ]; then - echo "F-Secure: Found" - echo "enable_fsma=no" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" - echo "update_servers=http://fsbwserver-direct.f-secure.com" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" - echo "update_proxies=http://$proxy_host:$proxy_port" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" - echo "http_proxies=http://$proxy_host:$proxy_port" >> "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" - cat "$chroot_dir/opt/f-secure/fsaua/fsaua_config.template" > "$chroot_dir/etc/opt/f-secure/fsaua/fsaua_config" - else - eco "F-Secure: NOT Found" - fi - - - rm "$tmp_file_344532" - tmp_file_344532= - - echo "done" -} - - -### dns -#dns_set [chroot_dir] [domain] [nameserver] -function dns_set() { - echo -n "set dns config ... " - - rm "$chroot_dir/etc/resolv.conf" - - [ "$2" != "" ] && echo "domain $2" >> "$chroot_dir/etc/resolv.conf" - echo "search $2" >> "$chroot_dir/etc/resolv.conf" - for namesv in `echo "$3" | tr "," " "`; do - echo "nameserver $namesv" >> "$chroot_dir/etc/resolv.conf" - done - - echo "done" -} - -### source list - -#sourcelist_desinfect_set_nomal2015 [chroot_dir] -function sourcelist_desinfect_set_nomal2015() { - echo -n "build normal source.list ... " - #$1 = chroot directory - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2015 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2015 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "# #### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "# ## developers who want to ship their latest software." >> "$sourcelist" - echo "# deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_nomal2016 [chroot_dir] -function sourcelist_desinfect_set_nomal2016() { - echo -n "build normal source.list ... " - #$1 = chroot directory - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2016 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2016 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "# #### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "# ## developers who want to ship their latest software." >> "$sourcelist" - echo "# deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_nomal2017 [chroot_dir] -function sourcelist_desinfect_set_nomal2017() { - echo -n "build normal source.list ... " - #$1 = chroot directory - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2017 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2017 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "# #### Ubuntu 16.04 LTS (Xenial) ####" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "# ## developers who want to ship their latest software." >> "$sourcelist" - echo "# deb http://extras.ubuntu.com/ubuntu xenial main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_extendet2015 [chroot_dir] -function sourcelist_desinfect_set_extendet2015() { - echo -n "build extendet source.list ... " - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2015 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2015 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "#### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "## developers who want to ship their latest software." >> "$sourcelist" - echo "deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_extendet2016 [chroot_dir] -function sourcelist_desinfect_set_extendet2016() { - echo -n "build extendet source.list ... " - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2016 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2016 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "#### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "## developers who want to ship their latest software." >> "$sourcelist" - echo "deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_extendet2017 [chroot_dir] -function sourcelist_desinfect_set_extendet2017() { - echo -n "build extendet source.list ... " - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2017 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2017 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "#### Ubuntu 16.04 LTS (Xenial) ####" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://security.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "## developers who want to ship their latest software." >> "$sourcelist" - echo "deb http://extras.ubuntu.com/ubuntu xenial main" >> "$sourcelist" - - echo "done" -} - -### Update ### - -#os_update [chroot_dir] -#-> proj/debian - -#os_update_desinfect2015 [chroot_dir] -function os_update_desinfect2015() { - #$1 = chroot directory - - chroot_dir="$1" - - #call main os_update - os_update "$chroot_dir" - - echo "update virus definitions ... " - - #BitDefender - chroot "$chroot_dir" /bin/bash -c "bdscan --update" | grep -v "... updated" - - #Avast Avira - chroot "$chroot_dir" /bin/bash -c "/AntiVirUpdate/avupdate" | grep -v " -> " - - #Clam AV - chroot "$chroot_dir" /bin/bash -c "freshclam" > /dev/null - rm -f "$chroot_dir/var/lib/clamav/daily.cld" - - #Karspersky - echo '#!/bin/bash' > "$chroot_dir/tmp/up_kasp" - echo 'PATH=/usr/lib/kl:$PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'LD_LIBRARY_PATH=/usr/lib/kl:$LD_LIBRARY_PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'KL_PLUGINS_PATH=/usr/lib/kl' >> "$chroot_dir/tmp/up_kasp" - echo 'export PATH LD_LIBRARY_PATH KL_PLUGINS_PATH' >> "$chroot_dir/tmp/up_kasp" - echo '/usr/lib/kl/kav update' >> "$chroot_dir/tmp/up_kasp" - chmod +x "$chroot_dir/tmp/up_kasp" - chroot "$chroot_dir" /bin/bash -c "/tmp/up_kasp" | grep -v ".kdc" | grep -v "File downloaded" - rm "$chroot_dir/tmp/up_kasp" - - - echo "done" -} - -#os_update_desinfect2016 [chroot_dir] -function os_update_desinfect2016() { - #$1 = chroot directory - - chroot_dir="$1" - - #call main os_update - os_update "$chroot_dir" - - echo "update virus definitions ... " - - #Avast Avira - { - echo "Avira ..." - chroot "$chroot_dir" /bin/bash -c "/AntiVirUpdate/avupdate" | grep -v " -> " - echo "Avira done" - } - - #Clam AV - { - echo "ClamAV..." - chroot "$chroot_dir" /bin/bash -c "freshclam" > /dev/null - rm -f "$chroot_dir/var/lib/clamav/daily.cld" - echo "ClamAV done" - } - - #Eset AV - { - echo "Eset AV ..." - tmp_file_23421="`mktemp`" - cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "av_update_username" | grep -v "av_update_password" > "$tmp_file_23421" - cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" - chroot "$chroot_dir" /bin/bash -c "/usr/bin/esetrand" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - echo "set timeout: 2min" - av_eaet_timeout=1200 - tmp_var_3092="`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" - - #eig. update routine - chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets restart" - sleep 2 - chroot "$chroot_dir" /bin/bash -c "/opt/eset/esets/sbin/esets_daemon --update" - - #warten auf daemon update ... - sleep 10m - echo "wait 10min for Eset AV update" - while [ "`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" == "$tmp_var_3092" ]; do - sleep 1 - av_eaet_timeout=$((av_eaet_timeout-1)) - [ $av_eaet_timeout -gt 0 ] || tmp_var_3092= - done - - sleep 4 - - chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets stop" - - cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - rm "$tmp_file_23421" - tmp_file_23421= - tmp_var_3092= - echo "Eset AV done" - } - - #Karspersky - { - echo "Karspersky ..." - #gen update-scrypt - echo '#!/bin/bash' > "$chroot_dir/tmp/up_kasp" - echo 'PATH=/usr/lib/kl:$PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'LD_LIBRARY_PATH=/usr/lib/kl:$LD_LIBRARY_PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'KL_PLUGINS_PATH=/usr/lib/kl' >> "$chroot_dir/tmp/up_kasp" - echo 'export PATH LD_LIBRARY_PATH KL_PLUGINS_PATH' >> "$chroot_dir/tmp/up_kasp" - echo '/usr/lib/kl/kav update' >> "$chroot_dir/tmp/up_kasp" - chmod +x "$chroot_dir/tmp/up_kasp" - - chroot "$chroot_dir" /bin/bash -c "/tmp/up_kasp" | grep -v ".kdc" | grep -v "File downloaded" - rm "$chroot_dir/tmp/up_kasp" - echo "Karspersky done" - } - - echo "update virus definitions done" -} - -#os_update_desinfect.17 [chroot_dir] -function os_update_desinfect.17() { - #$1 = chroot directory - - chroot_dir="$1" - - #call main os_update - os_update "$chroot_dir" - - echo "update virus definitions ... " - - #Avast Avira - { - echo "Avira ..." - #chroot "$chroot_dir" /bin/bash --login -c ". /tmp/env.sh; /AntiVirUpdate/avupdate" | grep -v " -> " - chroot_sh "$chroot_dir" "/AntiVirUpdate/avupdate" | grep -v " -> " - echo "Avira done" - } - - #Clam AV - { - echo "ClamAV..." - #chroot "$chroot_dir" /bin/bash --login -c ". /tmp/env.sh; freshclam" > /dev/null - chroot_sh "$chroot_dir" "freshclam" > /dev/null - rm -f "$chroot_dir/var/lib/clamav/daily.cld" - echo "ClamAV done" - } - - #Eset AV - { - echo "Eset AV ..." - tmp_file_23421="`mktemp`" - cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "av_update_username" | grep -v "av_update_password" > "$tmp_file_23421" - cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" - chroot "$chroot_dir" /bin/bash -c "/usr/bin/esetrand" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - av_eaet_timeout=300 - echo "set timeout: $((av_eaet_timeout/60))min" - tmp_var_3092="`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" - - #eig. update routine - #chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets restart" - chroot_sh "$chroot_dir" "/etc/init.d/esets restart" - sleep 2 - #chroot "$chroot_dir" /bin/bash --login -c "/opt/eset/esets/sbin/esets_daemon --update" - chroot_sh "$chroot_dir" "/opt/eset/esets/sbin/esets_daemon --update" - - #warten auf daemon update ... - echo "wait $((av_eaet_timeout/60))min for Eset AV update" - while [ "`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" == "$tmp_var_3092" ]; do - sleep 10 - av_eaet_timeout=$((av_eaet_timeout-10)) - [ $av_eaet_timeout -gt 0 ] || tmp_var_3092= - done - - sleep 4 - - #chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets stop" - chroot_sh "$chroot_dir" "/etc/init.d/esets stop" - - cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - rm "$tmp_file_23421" - tmp_file_23421= - tmp_var_3092= - echo "Eset AV done" - } - - #Sophos - { - echo "Sophos..." - #chroot "$chroot_dir" /bin/bash --login -c "/opt/sophos-av/bin/savupdate -v3" - chroot_sh "$chroot_dir" "/opt/sophos-av/bin/savupdate -v3" - chroot_sh "$chroot_dir" "/opt/sophos-av/bin/savdstatus --version" - #chroot "$chroot_dir" /bin/bash -c "/opt/sophos-av/bin/savupdate -v3 -a" - echo "Sophos done" - } - - #F-Secure - { - echo "F-Secure..." - chroot_sh "$chroot_dir" "/etc/init.d/fsaua start" - chroot_sh "$chroot_dir" "/etc/init.d/fsupdate stop" - ( sleep 1m; chroot_sh "$chroot_dir" "/etc/init.d/fsaua start" ) & - chroot_sh "$chroot_dir" "/opt/f-secure/fssp/bin/dbupdate_lite" && echo "Update Success" - sleep 1m - chroot_sh "$chroot_dir" "/etc/init.d/fsaua stop" - chroot_sh "$chroot_dir" "/etc/init.d/fsupdate stop" - echo "F-Secure done" - } - - echo "update virus definitions done" -} - - -### Tools ### - -#tools_add [chroot_dir] [tools_list] -#-> proj/debian - -#tools_add_desinfect2015 [chroot_dir] [tools_list] -function tools_add_desinfect2015() { - #$1 = chroot directory - chroot_dir="$1" - tools_list="$2" - - sourcelist_desinfect_set_extendet2015 "$chroot_dir" - tools_add "$chroot_dir" "$tools_list" - sourcelist_desinfect_set_nomal2015 "$chroot_dir" -} - -#tools_add_desinfect2016 [chroot_dir] [tools_list] -function tools_add_desinfect2016() { - #$1 = chroot directory - chroot_dir="$1" - tools_list="$2" - - sourcelist_desinfect_set_extendet2016 "$chroot_dir" - tools_add "$chroot_dir" "$tools_list" - sourcelist_desinfect_set_nomal2016 "$chroot_dir" -} - -#tools_add_desinfect.17 [chroot_dir] [tools_list] -function tools_add_desinfect.17() { - #$1 = chroot directory - chroot_dir="$1" - tools_list="$2" - - sourcelist_desinfect_set_extendet2017 "$chroot_dir" - tools_add "$chroot_dir" "$tools_list" - sourcelist_desinfect_set_nomal2017 "$chroot_dir" -} - source /proj/desinfect.17 ### Handle Parameters & Modes ### From fbf1a80b7bb6bf77da5165bc8277aa67201556b0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 13:05:02 +0200 Subject: [PATCH 33/55] add idear --- doc/draft_mod-pronects | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/draft_mod-pronects diff --git a/doc/draft_mod-pronects b/doc/draft_mod-pronects new file mode 100644 index 0000000..2e8f466 --- /dev/null +++ b/doc/draft_mod-pronects @@ -0,0 +1,19 @@ +maddl@NB-Maddl:~$ function a() { echo null; } +maddl@NB-Maddl:~$ a +null +maddl@NB-Maddl:~$ function a_desinfect() { echo desinfect; } +maddl@NB-Maddl:~$ a_desinfect +desinfect +maddl@NB-Maddl:~$ alias a=a_desinfect +maddl@NB-Maddl:~$ a +desinfect +maddl@NB-Maddl:~$ alias --help +bash: alias: --: Ungültige Option +alias: Gebrauch: alias [-p] [Name[=Wert] ... ] +maddl@NB-Maddl:~$ man alias +Kein Handbucheintrag für alias vorhanden +maddl@NB-Maddl:~$ alias a=a +maddl@NB-Maddl:~$ a +null +maddl@NB-Maddl:~$ + From f77f690751552b2e1708c63a5177b318bcbf94ea Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 16:15:36 +0200 Subject: [PATCH 34/55] change proj-head docu for script --- doc/proj-head | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/proj-head b/doc/proj-head index 2b70ea3..8b02794 100755 --- a/doc/proj-head +++ b/doc/proj-head @@ -3,6 +3,6 @@ [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } # -# . -> -> -source /proj/ +# +source /proj/ project_relation=" $project_relation" From 10dce09e4dbcee16c8daad16b3425893c92144af Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 16:16:07 +0200 Subject: [PATCH 35/55] add proj gen script --- script/add_project.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 script/add_project.sh diff --git a/script/add_project.sh b/script/add_project.sh new file mode 100755 index 0000000..5205581 --- /dev/null +++ b/script/add_project.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#check param +[ -z "$1" ] && { echo "$0 \"name\" [base]"; exit 1; } +name="$1" +base="$2" + +#gen project +cp "doc/proj-head" "src/proj/$name" + +#set base_relations +if [ -z "$base" ]; then + base_relations="base" + base="base" + sed -i "/project_relation=/c\project_relation=\"\"" "src/proj/$name" +else + [ -f "src/proj/$base" ] || { + echo "BASE: $base dont exist" + exit 1 + } + #get base of $base + base_base=`grep '# . ->' src/proj/$base` + base_relations=`echo $base_base | sed "s/#\ \./$base/g"` +fi + +## replace strings +# . -> -> base +sed -i "s//\ \.\ ->\ $base_relations/g" "src/proj/$name" +# +sed -i "s//$name/g" "src/proj/$name" +sed -i "s//$base/g" "src/proj/$name" + +#open +editor "src/proj/$name" From 8990b7ea1e66cb0010a6ea4d6898c4680a6da21e Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 16:16:22 +0200 Subject: [PATCH 36/55] add base template --- src/proj/base | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 src/proj/base diff --git a/src/proj/base b/src/proj/base new file mode 100755 index 0000000..6e03c0d --- /dev/null +++ b/src/proj/base @@ -0,0 +1,30 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +################## +##### B a s e #### +################## +# . +project_relation="" +[ -z "$project" ] && project=base + +#tools_add [chroot_dir] [tools_list] +function tools_add() { + echo "$project: tools_add ot available" +} + +#os_update [chroot_dir] +function os_update() { + echo "$project: os_update ot available" +} + +#proxy_enable [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable() { + echo "$project: proxy_enable ot available" +} + +#dns_set [chroot_dir] [domain] [nameserver] +function dns_set() { + echo "$project: dns_set ot available" +} From 013edd6c0f345ff662bee56bb4e2383a591be4b7 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 16:20:42 +0200 Subject: [PATCH 37/55] change debian template for script --- src/proj/debian | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/proj/debian b/src/proj/debian index 3ac9a45..299a347 100755 --- a/src/proj/debian +++ b/src/proj/debian @@ -2,11 +2,15 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } +source /proj/base +#debian +# . -> base +project_relation="debian" + #################################### ##### Base Template D E B I A N #### #################################### -# . -project_relation="debian" + #tools_add [chroot_dir] [tools_list] function tools_add() { From 15f5ad5fab6348176dd2f829367d239fd18d20d2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 21 May 2018 16:25:43 +0200 Subject: [PATCH 38/55] example in debian template --- src/proj/debian | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/proj/debian b/src/proj/debian index 299a347..107fbb5 100755 --- a/src/proj/debian +++ b/src/proj/debian @@ -13,7 +13,7 @@ project_relation="debian" #tools_add [chroot_dir] [tools_list] -function tools_add() { +function tools_add-debian() { echo "add tools ... " #$1 = chroot directory chroot_dir="$1" @@ -24,9 +24,10 @@ function tools_add() { chroot "$chroot_dir" /bin/bash -c "apt-get install -y $tools_list" | grep -v "wird eingerichtet ..." | grep -v "Vormals nicht ausgewähltes Paket" | grep -v "Entpacken von" | grep -v "Holen: " | grep -v "Trigger für" | grep -v "update-alternatives:" echo "done" } +alias tools_add="tools_add-debian" #os_update [chroot_dir] -function os_update() { +function os_update-debian() { echo "updating os ... " #$1 = chroot directory @@ -39,9 +40,10 @@ function os_update() { echo "done" } +alias os_update="os_update-debian" #proxy_enable [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable() { +function proxy_enable-debian() { echo -n "enable proxy ... " chroot_dir="$1" @@ -77,9 +79,10 @@ function proxy_enable() { fi fi } +alias proxy_enable="proxy_enable-debian" #dns_set [chroot_dir] [domain] [nameserver] -function dns_set() { +function dns_set-debian() { echo -n "set dns config ... " rm "$chroot_dir/etc/resolv.conf" @@ -92,3 +95,4 @@ function dns_set() { echo "done" } +alias dns_set="dns_set-debian" From c4eeb44eaaff4b12de5912b97d2fd91dec1c6e30 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 00:30:51 +0200 Subject: [PATCH 39/55] use online functions instead alias --- src/proj/debian | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/proj/debian b/src/proj/debian index 107fbb5..5fe9c2b 100755 --- a/src/proj/debian +++ b/src/proj/debian @@ -24,7 +24,7 @@ function tools_add-debian() { chroot "$chroot_dir" /bin/bash -c "apt-get install -y $tools_list" | grep -v "wird eingerichtet ..." | grep -v "Vormals nicht ausgewähltes Paket" | grep -v "Entpacken von" | grep -v "Holen: " | grep -v "Trigger für" | grep -v "update-alternatives:" echo "done" } -alias tools_add="tools_add-debian" +function tools_add() { tools_add-debian $@ } #os_update [chroot_dir] function os_update-debian() { @@ -40,7 +40,7 @@ function os_update-debian() { echo "done" } -alias os_update="os_update-debian" +function os_update() { os_update-debian $@ } #proxy_enable [chroot_dir] [proxy_host] [proxy_port] function proxy_enable-debian() { @@ -79,7 +79,7 @@ function proxy_enable-debian() { fi fi } -alias proxy_enable="proxy_enable-debian" +function proxy_enable() { proxy_enable-debian $@ } #dns_set [chroot_dir] [domain] [nameserver] function dns_set-debian() { @@ -95,4 +95,4 @@ function dns_set-debian() { echo "done" } -alias dns_set="dns_set-debian" +function dns_set() { dns_set-debian $@ } From 29a8d529c9b2502478f9ea4a3c2b85d2d116c9d1 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 00:46:31 +0200 Subject: [PATCH 40/55] remove special function cals --- src/remaster.sh | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/remaster.sh b/src/remaster.sh index d6060d2..39e6228 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -111,8 +111,6 @@ function main_renew() { check_update >> "$log_file" - [ "$project" != "" ] && project="_$project" - # 2. Entpacke ISO iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" @@ -128,12 +126,12 @@ function main_renew() { # 4. Vorbereiten für chroot-Umgebung: - chroot_initial$project "$chroot_path" >> "$log_file" + chroot_initial "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Setzen der Netzwerk-Einstellungen: [ -n "$proxy_host" ] && { - proxy_enable$project "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } @@ -141,12 +139,12 @@ function main_renew() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 6. Updaten von Desinfec't: - os_update$project "$chroot_path" >> "$log_file" + os_update "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 7. Installation optionaler Tools: - tools_add$project "$chroot_path" "$tools_list" >> "$log_file" + tools_add "$chroot_path" "$tools_list" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #addo ClamAV to conky_info @@ -169,7 +167,7 @@ function main_renew() { # 9. Umount - Chroot Umgebung auflösen - chroot_umount$project "$chroot_path" >> "$log_file" + chroot_umount "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #Überprüfen ob alles ausgehängt wurde @@ -187,7 +185,7 @@ function main_renew() { # wenn iso gewünscht [ "$iso_aim" != "" ] && { - iso_create$project "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } @@ -266,8 +264,6 @@ function main_update_pxe() { check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - [ "$project" != "" ] && project="_$project" - # 1. Entpacken der Dateien des Live-Systems [ -e "$squashfs_path" ] || { echo "### ERROR ### \"$squashfs_path\" does not exist!" >> "$log_file" @@ -279,7 +275,7 @@ function main_update_pxe() { # 2. Vorbereiten für chroot-Umgebung: - chroot_initial$project "$chroot_path" >> "$log_file" + chroot_initial "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 3. Setzen der Netzwerk-Einstellungen: @@ -288,7 +284,7 @@ function main_update_pxe() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 4. Updaten von Desinfec't: - os_update$project "$chroot_path" >> "$log_file" + os_update "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Manuelle Aktionen - deaktiviert @@ -301,7 +297,7 @@ function main_update_pxe() { # 6. Umount - Chroot Umgebung auflösen - chroot_umount$project "$chroot_path" >> "$log_file" + chroot_umount "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #Überprüfen ob alles ausgehängt wurde @@ -391,8 +387,6 @@ function main_update_iso() { check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - [ "$project" != "" ] && project="_$project" - # 2. Entpacke ISO iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" @@ -418,12 +412,12 @@ function main_update_iso() { # 4. Vorbereiten für chroot-Umgebung: - chroot_initial$project "$chroot_path" >> "$log_file" + chroot_initial "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 5. Setzen der Netzwerk-Einstellungen: [ -n "$proxy_host" ] && { - proxy_enable$project "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } @@ -431,12 +425,12 @@ function main_update_iso() { error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 6. Updaten von Desinfec't: - os_update$project "$chroot_path" >> "$log_file" + os_update "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" # 7. Installation optionaler Tools: - tools_add$project "$chroot_path" "$tools_list" >> "$log_file" + tools_add "$chroot_path" "$tools_list" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #addo ClamAV to conky_info @@ -454,7 +448,7 @@ function main_update_iso() { # 9. Umount - Chroot Umgebung auflösen - chroot_umount$project "$chroot_path" >> "$log_file" + chroot_umount "$chroot_path" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" #Überprüfen ob alles ausgehängt wurde @@ -472,7 +466,7 @@ function main_update_iso() { # wenn iso gewünscht [ "$iso_aim" != "" ] && { - iso_create$project "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } @@ -566,7 +560,10 @@ source /func/chroot_is_mounted #chroot_sh [chroot_dir] [command] source /func/chroot_sh +#################################### +### Workaround - set Project source /proj/desinfect.17 +#################################### ### Handle Parameters & Modes ### From 2752dcc5ca8dcd15a6942b315502495bc4b0581b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 00:47:11 +0200 Subject: [PATCH 41/55] change desinfect.17 to overload some funktions --- src/proj/desinfect.17 | 49 ++++++++++++------------------------------- 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/src/proj/desinfect.17 b/src/proj/desinfect.17 index 6f6d334..e4085da 100755 --- a/src/proj/desinfect.17 +++ b/src/proj/desinfect.17 @@ -69,14 +69,14 @@ function sourcelist_desinfect_set_extendet2017() { echo "done" } -#os_update_desinfect.17 [chroot_dir] -function os_update_desinfect.17() { +#os_update-desinfect.17 [chroot_dir] +function os_update-desinfect.17() { #$1 = chroot directory chroot_dir="$1" - #call main os_update - os_update "$chroot_dir" + #call main os_update from debian + os_update-debian "$chroot_dir" echo "update virus definitions ... " @@ -162,37 +162,12 @@ function os_update_desinfect.17() { echo "update virus definitions done" } +function os_update() { os_update-desinfect.17 $@ } -#iso_create_desinfect.17 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create_desinfect.17() { - #echo "prepere iso folder ... " +#proxy_enable-desinfect.17 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable-desinfect.17() { - chroot_path="$1" - iso_extr_dir="$2" - iso_aim="$3" - iso_lable="$4" - - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" -} - -#chroot_initial_desinfect.17 [chroot_dir] -function chroot_initial_desinfect.17() { - #$1 = chroot dir - - chroot_initial "$1" - -} - -#chroot_umount_desinfect.17 [chroot_dir] -function chroot_umount_desinfect.17() { - #call main mount - chroot_umount "$1" -} - -#proxy_enable_desinfect.17 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect.17() { - - proxy_enable $1 $2 $3 + proxy_enable-debian $1 $2 $3 echo "enable proxy for desinfect's av ... " @@ -262,14 +237,16 @@ function proxy_enable_desinfect.17() { echo "done" } +function proxy_enable() { proxy_enable-desinfect.17 $@ } -#tools_add_desinfect.17 [chroot_dir] [tools_list] -function tools_add_desinfect.17() { +#tools_add-desinfect.17 [chroot_dir] [tools_list] +function tools_add-desinfect.17() { #$1 = chroot directory chroot_dir="$1" tools_list="$2" sourcelist_desinfect_set_extendet2017 "$chroot_dir" - tools_add "$chroot_dir" "$tools_list" + tools_add-debian "$chroot_dir" "$tools_list" sourcelist_desinfect_set_nomal2017 "$chroot_dir" } +function tools_add() { tools_add-desinfect.17 $@ } From 32d09b764b1fe47f091e37ad7aca56d6f92e1954 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 00:58:05 +0200 Subject: [PATCH 42/55] overlod functions... --- src/proj/desinfect.15 | 42 ++++++++++++++++++--------------- src/proj/desinfect.16 | 54 ++++++++++++++++--------------------------- 2 files changed, 44 insertions(+), 52 deletions(-) diff --git a/src/proj/desinfect.15 b/src/proj/desinfect.15 index 7639578..0bc0081 100755 --- a/src/proj/desinfect.15 +++ b/src/proj/desinfect.15 @@ -9,8 +9,8 @@ project_relation="desinfect.15 $project_relation" -#iso_create_desinfect2015 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create_desinfect2015() { +#iso_create-desinfect.15 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] +function iso_create-desinfect.15() { echo "prepere iso folder ... " chroot_path="$1" @@ -24,14 +24,15 @@ function iso_create_desinfect2015() { echo "done" - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" + iso_create-debian "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" } +function iso_create() { iso_create-desinfect.15 $@ } -#chroot_initial_desinfect2015 [chroot_dir] -function chroot_initial_desinfect2015() { +#chroot_initial-desinfect.15 [chroot_dir] +function chroot_initial-desinfect.15() { #$1 = chroot dir - chroot_initial "$1" + chroot_initial-debian "$1" echo -n "initial desinfect on chroot ... " @@ -49,11 +50,12 @@ function chroot_initial_desinfect2015() { echo "done" } +function iso_create() { iso_create-desinfect.15 $@ } -#chroot_umount_desinfect2015 [chroot_dir] -function chroot_umount_desinfect2015() { +#chroot_umount-desinfect.15 [chroot_dir] +function chroot_umount-desinfect.15() { #call main mount - chroot_umount "$1" + chroot_umount-debian "$1" echo -n "unmount desinfect on chroot ... " #check chroot dir @@ -74,11 +76,12 @@ function chroot_umount_desinfect2015() { echo "done" } +function chroot_umount() { chroot_umount-desinfect.15 $@ } -#proxy_enable_desinfect2015 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect2015() { +#proxy_enable-desinfect.15 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable-desinfect.15() { - proxy_enable $1 $2 $3 + proxy_enable-debian $1 $2 $3 echo -n "enable proxy for desinfect's av ... " @@ -105,6 +108,7 @@ function proxy_enable_desinfect2015() { echo "done" } +function proxy_enable() { proxy_enable-desinfect.15 $@ } #sourcelist_desinfect_set_nomal2015 [chroot_dir] function sourcelist_desinfect_set_nomal2015() { @@ -173,14 +177,14 @@ function sourcelist_desinfect_set_extendet2015() { echo "done" } -#os_update_desinfect2015 [chroot_dir] -function os_update_desinfect2015() { +#os_update-desinfect.15 [chroot_dir] +function os_update-desinfect.15() { #$1 = chroot directory chroot_dir="$1" #call main os_update - os_update "$chroot_dir" + os_update-debian "$chroot_dir" echo "update virus definitions ... " @@ -208,14 +212,16 @@ function os_update_desinfect2015() { echo "done" } +function os_update() { os_update-desinfect.15 $@ } -#tools_add_desinfect2015 [chroot_dir] [tools_list] -function tools_add_desinfect2015() { +#tools_add-desinfect.15 [chroot_dir] [tools_list] +function tools_add-desinfect.15() { #$1 = chroot directory chroot_dir="$1" tools_list="$2" sourcelist_desinfect_set_extendet2015 "$chroot_dir" - tools_add "$chroot_dir" "$tools_list" + tools_add-debian "$chroot_dir" "$tools_list" sourcelist_desinfect_set_nomal2015 "$chroot_dir" } +function tools_add() { tools_add-desinfect.15 $@ } diff --git a/src/proj/desinfect.16 b/src/proj/desinfect.16 index 9c8246d..03e8d60 100755 --- a/src/proj/desinfect.16 +++ b/src/proj/desinfect.16 @@ -8,30 +8,11 @@ source /proj/ubuntu.14.04 project_relation="desinfect.16 $project_relation" - -#iso_create_desinfect2016 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create_desinfect2016() { - #echo "prepere iso folder ... " - - chroot_path="$1" - iso_extr_dir="$2" - iso_aim="$3" - iso_lable="$4" - - #desinfect - #rm "$iso_extr_dir/casper/initrd.lz" - #wget http://www.heise.de/ct/projekte/desinfect/des15/initrd.lz -O "$iso_extr_dir/casper/initrd.lz" - - #echo "done" - - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" -} - -#chroot_initial_desinfect2016 [chroot_dir] -function chroot_initial_desinfect2016() { +#chroot_initial-desinfect.16 [chroot_dir] +function chroot_initial-desinfect.16() { #$1 = chroot dir - chroot_initial "$1" + chroot_initial-debian "$1" echo -n "initial desinfect on chroot ... " @@ -47,11 +28,12 @@ function chroot_initial_desinfect2016() { echo "done" } +function chroot_initial() { chroot_initial-desinfect.16 $@ } -#chroot_umount_desinfect2016 [chroot_dir] -function chroot_umount_desinfect2016() { +#chroot_umount-desinfect.16 [chroot_dir] +function chroot_umount-desinfect.16() { #call main mount - chroot_umount "$1" + chroot_umount-debian "$1" echo -n "unmount desinfect on chroot ... " #check chroot dir @@ -69,11 +51,12 @@ function chroot_umount_desinfect2016() { echo "done" } +function chroot_umount() { chroot_umount-desinfect.16 $@ } -#proxy_enable_desinfect2016 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable_desinfect2016() { +#proxy_enable-desinfect.16 [chroot_dir] [proxy_host] [proxy_port] +function proxy_enable-desinfect.16() { - proxy_enable $1 $2 $3 + proxy_enable-debian $1 $2 $3 echo -n "enable proxy for desinfect's av ... " @@ -112,6 +95,7 @@ function proxy_enable_desinfect2016() { echo "done" } +function proxy_enable() { proxy_enable-desinfect.16 $@ } #sourcelist_desinfect_set_nomal2016 [chroot_dir] function sourcelist_desinfect_set_nomal2016() { @@ -180,14 +164,14 @@ function sourcelist_desinfect_set_extendet2016() { echo "done" } -#os_update_desinfect2016 [chroot_dir] -function os_update_desinfect2016() { +#os_update-desinfect.16 [chroot_dir] +function os_update-desinfect.16() { #$1 = chroot directory chroot_dir="$1" #call main os_update - os_update "$chroot_dir" + os_update-debian "$chroot_dir" echo "update virus definitions ... " @@ -263,14 +247,16 @@ function os_update_desinfect2016() { echo "update virus definitions done" } +function os_update() { os_update-desinfect.16 $@ } -#tools_add_desinfect2016 [chroot_dir] [tools_list] -function tools_add_desinfect2016() { +#tools_add-desinfect.16 [chroot_dir] [tools_list] +function tools_add-desinfect.16() { #$1 = chroot directory chroot_dir="$1" tools_list="$2" sourcelist_desinfect_set_extendet2016 "$chroot_dir" - tools_add "$chroot_dir" "$tools_list" + tools_add-debian "$chroot_dir" "$tools_list" sourcelist_desinfect_set_nomal2016 "$chroot_dir" } +function tools_add() { tools_add-desinfect.16 $@ } From 04e4e98525e64d165bd952d633336b2d652516de Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:05:32 +0200 Subject: [PATCH 43/55] semilicon fix --- src/proj/debian | 8 ++++---- src/proj/desinfect.15 | 12 ++++++------ src/proj/desinfect.16 | 10 +++++----- src/proj/desinfect.17 | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/proj/debian b/src/proj/debian index 5fe9c2b..196dbe2 100755 --- a/src/proj/debian +++ b/src/proj/debian @@ -24,7 +24,7 @@ function tools_add-debian() { chroot "$chroot_dir" /bin/bash -c "apt-get install -y $tools_list" | grep -v "wird eingerichtet ..." | grep -v "Vormals nicht ausgewähltes Paket" | grep -v "Entpacken von" | grep -v "Holen: " | grep -v "Trigger für" | grep -v "update-alternatives:" echo "done" } -function tools_add() { tools_add-debian $@ } +function tools_add() { tools_add-debian $@; } #os_update [chroot_dir] function os_update-debian() { @@ -40,7 +40,7 @@ function os_update-debian() { echo "done" } -function os_update() { os_update-debian $@ } +function os_update() { os_update-debian $@; } #proxy_enable [chroot_dir] [proxy_host] [proxy_port] function proxy_enable-debian() { @@ -79,7 +79,7 @@ function proxy_enable-debian() { fi fi } -function proxy_enable() { proxy_enable-debian $@ } +function proxy_enable() { proxy_enable-debian $@; } #dns_set [chroot_dir] [domain] [nameserver] function dns_set-debian() { @@ -95,4 +95,4 @@ function dns_set-debian() { echo "done" } -function dns_set() { dns_set-debian $@ } +function dns_set() { dns_set-debian $@; } diff --git a/src/proj/desinfect.15 b/src/proj/desinfect.15 index 0bc0081..02302d7 100755 --- a/src/proj/desinfect.15 +++ b/src/proj/desinfect.15 @@ -26,7 +26,7 @@ function iso_create-desinfect.15() { iso_create-debian "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" } -function iso_create() { iso_create-desinfect.15 $@ } +function iso_create() { iso_create-desinfect.15 $@; } #chroot_initial-desinfect.15 [chroot_dir] function chroot_initial-desinfect.15() { @@ -50,7 +50,7 @@ function chroot_initial-desinfect.15() { echo "done" } -function iso_create() { iso_create-desinfect.15 $@ } +function iso_create() { iso_create-desinfect.15 $@; } #chroot_umount-desinfect.15 [chroot_dir] function chroot_umount-desinfect.15() { @@ -76,7 +76,7 @@ function chroot_umount-desinfect.15() { echo "done" } -function chroot_umount() { chroot_umount-desinfect.15 $@ } +function chroot_umount() { chroot_umount-desinfect.15 $@; } #proxy_enable-desinfect.15 [chroot_dir] [proxy_host] [proxy_port] function proxy_enable-desinfect.15() { @@ -108,7 +108,7 @@ function proxy_enable-desinfect.15() { echo "done" } -function proxy_enable() { proxy_enable-desinfect.15 $@ } +function proxy_enable() { proxy_enable-desinfect.15 $@; } #sourcelist_desinfect_set_nomal2015 [chroot_dir] function sourcelist_desinfect_set_nomal2015() { @@ -212,7 +212,7 @@ function os_update-desinfect.15() { echo "done" } -function os_update() { os_update-desinfect.15 $@ } +function os_update() { os_update-desinfect.15 $@; } #tools_add-desinfect.15 [chroot_dir] [tools_list] function tools_add-desinfect.15() { @@ -224,4 +224,4 @@ function tools_add-desinfect.15() { tools_add-debian "$chroot_dir" "$tools_list" sourcelist_desinfect_set_nomal2015 "$chroot_dir" } -function tools_add() { tools_add-desinfect.15 $@ } +function tools_add() { tools_add-desinfect.15 $@; } diff --git a/src/proj/desinfect.16 b/src/proj/desinfect.16 index 03e8d60..89e5d5a 100755 --- a/src/proj/desinfect.16 +++ b/src/proj/desinfect.16 @@ -28,7 +28,7 @@ function chroot_initial-desinfect.16() { echo "done" } -function chroot_initial() { chroot_initial-desinfect.16 $@ } +function chroot_initial() { chroot_initial-desinfect.16 $@; } #chroot_umount-desinfect.16 [chroot_dir] function chroot_umount-desinfect.16() { @@ -51,7 +51,7 @@ function chroot_umount-desinfect.16() { echo "done" } -function chroot_umount() { chroot_umount-desinfect.16 $@ } +function chroot_umount() { chroot_umount-desinfect.16 $@; } #proxy_enable-desinfect.16 [chroot_dir] [proxy_host] [proxy_port] function proxy_enable-desinfect.16() { @@ -95,7 +95,7 @@ function proxy_enable-desinfect.16() { echo "done" } -function proxy_enable() { proxy_enable-desinfect.16 $@ } +function proxy_enable() { proxy_enable-desinfect.16 $@; } #sourcelist_desinfect_set_nomal2016 [chroot_dir] function sourcelist_desinfect_set_nomal2016() { @@ -247,7 +247,7 @@ function os_update-desinfect.16() { echo "update virus definitions done" } -function os_update() { os_update-desinfect.16 $@ } +function os_update() { os_update-desinfect.16 $@; } #tools_add-desinfect.16 [chroot_dir] [tools_list] function tools_add-desinfect.16() { @@ -259,4 +259,4 @@ function tools_add-desinfect.16() { tools_add-debian "$chroot_dir" "$tools_list" sourcelist_desinfect_set_nomal2016 "$chroot_dir" } -function tools_add() { tools_add-desinfect.16 $@ } +function tools_add() { tools_add-desinfect.16 $@; } diff --git a/src/proj/desinfect.17 b/src/proj/desinfect.17 index e4085da..18c99f3 100755 --- a/src/proj/desinfect.17 +++ b/src/proj/desinfect.17 @@ -162,7 +162,7 @@ function os_update-desinfect.17() { echo "update virus definitions done" } -function os_update() { os_update-desinfect.17 $@ } +function os_update() { os_update-desinfect.17 $@; } #proxy_enable-desinfect.17 [chroot_dir] [proxy_host] [proxy_port] function proxy_enable-desinfect.17() { @@ -237,7 +237,7 @@ function proxy_enable-desinfect.17() { echo "done" } -function proxy_enable() { proxy_enable-desinfect.17 $@ } +function proxy_enable() { proxy_enable-desinfect.17 $@; } #tools_add-desinfect.17 [chroot_dir] [tools_list] function tools_add-desinfect.17() { @@ -249,4 +249,4 @@ function tools_add-desinfect.17() { tools_add-debian "$chroot_dir" "$tools_list" sourcelist_desinfect_set_nomal2017 "$chroot_dir" } -function tools_add() { tools_add-desinfect.17 $@ } +function tools_add() { tools_add-desinfect.17 $@; } From 9b5cc1665d8d9ff7b7f4e19c528fe0508b490c5c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:14:21 +0200 Subject: [PATCH 44/55] use renew as base template --- src/config.sample.cfg | 3 --- src/remaster.sh | 11 ++++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/config.sample.cfg b/src/config.sample.cfg index 21fd3e2..30cbfbb 100644 --- a/src/config.sample.cfg +++ b/src/config.sample.cfg @@ -4,9 +4,6 @@ ## sample-config rename it to config.cfg after changes ## ######################################################### -## MODUS -modus_default="update_pxe" - #CD/DVD #entweder iso_source oder squashfs_path alls quelle # -> bei iso gen erforderlich! diff --git a/src/remaster.sh b/src/remaster.sh index 39e6228..5992b24 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -565,11 +565,8 @@ source /func/chroot_sh source /proj/desinfect.17 #################################### -### Handle Parameters & Modes ### - +########################################################### +################# P r o c e s s ... ####################### +########################################################### #wenn kein modus angegebnen: default modus -if [ -z "$1" ]; then - main_$modus_default -else - main_$1 $2 $3 $4 $5 $6 $7 $8 $9 -fi +main_renew From eb96f7a0e41be5bd7090a1f3a84090425380dd92 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:15:08 +0200 Subject: [PATCH 45/55] rm unused modes --- src/remaster.sh | 282 ------------------------------------------------ 1 file changed, 282 deletions(-) diff --git a/src/remaster.sh b/src/remaster.sh index 5992b24..ac587f4 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -209,288 +209,6 @@ function main_renew() { on_exit 0 } -#remaster.sh update_pxe -function main_update_pxe() { - - #Start LOG - tail -f "$log_file" --pid="$$" & - - chroot_path="`mktemp -d`" - - echo "Remaster LOG `date '+%Y-%m-%d'`" > "$log_file" - echo "MODE: update_pxe" >> "$log_file" - echo "HOST: `hostname`" >> "$log_file" - echo >> "$log_file" - - echo "### S e t t i n g s ###" >> "$log_file" - echo "#Filesystem (for pxe)" >> "$log_file" - echo "squashfs_path=\"$squashfs_path\"" - echo >> "$log_file" - - echo "#Network" >> "$log_file" - echo "domain=\"$domain\"" >> "$log_file" - echo "nameserver=\"$nameserver\"" >> "$log_file" - echo >> "$log_file" - - echo "#remaster_script" >> "$log_file" - echo "project=\"$project\"" >> "$log_file" - echo >> "$log_file" - - echo "log_file=\"$log_file\"" - echo "log_mail_aim=\"$log_mail_aim\"" - echo "log_mail_subject=\"$log_mail_subject\"" - echo "" - - echo "#Sonstiges" >> "$log_file" - echo "tools_list=\"$tools_list\"" >> "$log_file" - echo $'\n' >> "$log_file" - - echo "### Enviroment ###" - echo "chroot_path=\"$chroot_path\"" >> "$log_file" - #env >> "$log_file" - echo $'\n\n' >> "$log_file" - - echo $'### R U N ... ###\n' >> "$log_file" - - #1. Set and Check Enviroment - check_user >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_update >> "$log_file" - - check_dependency >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_config >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 1. Entpacken der Dateien des Live-Systems - [ -e "$squashfs_path" ] || { - echo "### ERROR ### \"$squashfs_path\" does not exist!" >> "$log_file" - on_exit 15 >> "$log_file" - } - - filesystem_extract "$squashfs_path" "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 2. Vorbereiten für chroot-Umgebung: - - chroot_initial "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 3. Setzen der Netzwerk-Einstellungen: - - dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 4. Updaten von Desinfec't: - os_update "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 5. Manuelle Aktionen - deaktiviert - - echo "Now You Have TIME to do something MANUALY!" - #echo "enter in shell: - chroot $chroot_path /bin/bash - #echo "Are You Finisch? Then Press [ENTER]" - #read - - # 6. Umount - Chroot Umgebung auflösen - - chroot_umount "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - #Überprüfen ob alles ausgehängt wurde - [ "`chroot_is_mounted "$chroot_path"`" == "true" ] && { - echo "### ERROR ### Cant Unmount Chroot!" >> "$log_file" - on_exit 21 >> "$log_file" - } - - # 5. Packen und Ersetzen der Dateien - rm "$squashfs_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - filesystem_pack "$chroot_path" "$squashfs_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - chmod 777 "$squashfs_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - workspace_erase "$chroot_path/" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - - on_exit 0 -} - -#remaster.sh update_iso #in arbeit -function main_update_iso() { - #Start LOG - tail -f "$log_file" --pid="$$" & - - chroot_path="`mktemp -d`" - iso_extr_dir="`mktemp -d`" - - echo "Remaster LOG `date '+%Y-%m-%d'`" > "$log_file" - echo "MODE: update_iso" >> "$log_file" - echo "HOST: `hostname`" >> "$log_file" - echo >> "$log_file" - - echo "### S e t t i n g s ###" >> "$log_file" - echo "#CD/DVD" >> "$log_file" - echo "iso_source=\"$iso_source\"" >> "$log_file" - echo "iso_aim=\"$iso_aim\"" >> "$log_file" - echo "iso_lable=\"$iso_lable\"" >> "$log_file" - echo >> "$log_file" - - echo "#Filesystem (for pxe)" >> "$log_file" - echo "squashfs_path=\"$squashfs_path\"" >> "$log_file" - echo >> "$log_file" - - echo "#Network" >> "$log_file" - echo "proxy_host=\"$proxy_host\"" >> "$log_file" - echo "proxy_port=\"$proxy_port\"" >> "$log_file" - echo "domain=\"$domain\"" >> "$log_file" - echo "nameserver=\"$nameserver\"" >> "$log_file" - echo >> "$log_file" - - echo "#remaster_script" >> "$log_file" - echo "project=\"$project\"" >> "$log_file" - echo >> "$log_file" - - echo "log_file=\"$log_file\"" - echo "log_mail_aim=\"$log_mail_aim\"" - echo "log_mail_subject=\"$log_mail_subject\"" - echo "" - - echo "#Sonstiges" >> "$log_file" - echo "tools_list=\"$tools_list\"" >> "$log_file" - echo $'\n' >> "$log_file" - - echo "### Enviroment ###" - echo "iso_extr_dir=\"$iso_extr_dir\"" >> "$log_file" - echo "chroot_path=\"$chroot_path\"" >> "$log_file" - #env >> "$log_file" - echo $'\n\n' >> "$log_file" - - echo $'### R U N ... ###\n' >> "$log_file" - - #1. Set and Check Enviroment - check_user >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_update >> "$log_file" - - check_dependency >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_config >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 2. Entpacke ISO - iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" - - # 3. Checke pxe version - # if pxe is set - # if (date != date ); then $0 update_pxe #4.1 - # filesystem = update #4.2 - # else - # extrakt filesystem #5. - # update #6. - # done - # pack iso - - # 3. Entpacken der Dateien des Live-Systems - filesystem_img="`find "$iso_extr_dir" -name filesystem.squashfs`" - [ -e "$filesystem_img" ] || { - echo "### ERROR ### Image \"$iso_source\" has no \"filesystem.squashfs\"" >> "$log_file" - on_exit 15 >> "$log_file" - } - - filesystem_extract "$filesystem_img" "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 4. Vorbereiten für chroot-Umgebung: - - chroot_initial "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 5. Setzen der Netzwerk-Einstellungen: - [ -n "$proxy_host" ] && { - proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - } - - dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 6. Updaten von Desinfec't: - os_update "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 7. Installation optionaler Tools: - - tools_add "$chroot_path" "$tools_list" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - #addo ClamAV to conky_info - sed -i 's/# ${color white}ClamAV/ ${color white}ClamAV/g' "$chroot_path/etc/skel/.conkyrc" - - chroot_clean "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 8. Manuelle Aktionen - deaktiviert - - #echo "Now You Have TIME to do something MANUALY!" - #echo "enter in shell: #> chroot $chroot_path /bin/bash" - #chroot $chroot_path /bin/bash - #echo "Are You Finisch? Then Press [ENTER]" - - # 9. Umount - Chroot Umgebung auflösen - - chroot_umount "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - #Überprüfen ob alles ausgehängt wurde - [ "`chroot_is_mounted "$chroot_path"`" == "true" ] && { - echo "### ERROR ### Cant Unmount Chroot!" >> "$log_file" - on_exit 21 >> "$log_file" - } - - # 10. Packen und Ersetzen der Dateien des Live-Systems - rm "$filesystem_img" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - filesystem_pack "$chroot_path" "$filesystem_img" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # wenn iso gewünscht - [ "$iso_aim" != "" ] && { - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - } - - # wenn filesystem gewünscht - [ "$squashfs_path" != "" ] && { - #wen bereits forhanden dann löschen - [ -f "$squashfs_path" ] && rm "$squashfs_path" - cp "$filesystem_img" "$squashfs_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - chmod 666 "$squashfs_path" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - } - - chmod 666 "$iso_aim" "$filesystem_img" >> "$log_file" - - #11. End - workspace_erase "$iso_extr_dir/" "$chroot_path/" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - - on_exit 0 -} - ##################################################################################### ################## F u n c t i o n s ################################################ ##################################################################################### From 756d389c6dbd100c2b61ba65fc5211f96d210132 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:16:14 +0200 Subject: [PATCH 46/55] mv renew position --- src/remaster.sh | 327 +++++++++++++++++++++++------------------------- 1 file changed, 159 insertions(+), 168 deletions(-) diff --git a/src/remaster.sh b/src/remaster.sh index ac587f4..e4fe7b1 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -43,172 +43,6 @@ fi fi } -##################################################################################### -################## M o d e s ######################################################## -##################################################################################### - -#remaster.sh renew -function main_renew() { - #Start LOG - tail -f "$log_file" --pid="$$" & - - chroot_path="`mktemp -d`" - iso_extr_dir="`mktemp -d`" - - echo "Remaster LOG `date '+%Y-%m-%d'`" > "$log_file" - echo "MODE: renew" >> "$log_file" - echo "HOST: `hostname`" >> "$log_file" - echo >> "$log_file" - - echo "### S e t t i n g s ###" >> "$log_file" - echo "#CD/DVD" >> "$log_file" - echo "iso_source=\"$iso_source\"" >> "$log_file" - echo "iso_aim=\"$iso_aim\"" >> "$log_file" - echo "iso_lable=\"$iso_lable\"" >> "$log_file" - echo >> "$log_file" - - echo "#Filesystem (for pxe)" >> "$log_file" - echo "squashfs_path=\"$squashfs_path\"" >> "$log_file" - echo >> "$log_file" - - echo "#Network" >> "$log_file" - echo "proxy_host=\"$proxy_host\"" >> "$log_file" - echo "proxy_port=\"$proxy_port\"" >> "$log_file" - echo "domain=\"$domain\"" >> "$log_file" - echo "nameserver=\"$nameserver\"" >> "$log_file" - echo >> "$log_file" - - echo "#remaster_script" >> "$log_file" - echo "project=\"$project\"" >> "$log_file" - echo >> "$log_file" - - echo "log_file=\"$log_file\"" - echo "log_mail_aim=\"$log_mail_aim\"" - echo "log_mail_subject=\"$log_mail_subj >> "$log_file"ect\"" - echo "" - - echo "#Sonstiges" >> "$log_file" - echo "tools_list=\"$tools_list\"" >> "$log_file" - echo $'\n' >> "$log_file" - - echo "### Enviroment ###" - echo "iso_extr_dir=\"$iso_extr_dir\"" >> "$log_file" - echo "chroot_path=\"$chroot_path\"" >> "$log_file" - #env >> "$log_file" - echo $'\n\n' >> "$log_file" - - echo $'### R U N ... ###\n' >> "$log_file" - - #1. Set and Check Enviroment - check_user >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_dependency >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_config >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - check_update >> "$log_file" - - # 2. Entpacke ISO - iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" - - # 3. Entpacken der Dateien des Live-Systems - filesystem_img="`find "$iso_extr_dir" -name filesystem.squashfs`" - [ -e "$filesystem_img" ] || { - echo "### ERROR ### Image \"$iso_source\" has no \"filesystem.squashfs\"" >> "$log_file" - on_exit 15 >> "$log_file" - } - - filesystem_extract "$filesystem_img" "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 4. Vorbereiten für chroot-Umgebung: - - chroot_initial "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 5. Setzen der Netzwerk-Einstellungen: - [ -n "$proxy_host" ] && { - proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - } - - dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 6. Updaten von Desinfec't: - os_update "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 7. Installation optionaler Tools: - - tools_add "$chroot_path" "$tools_list" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - #addo ClamAV to conky_info - sed -i 's/# ${color white}ClamAV/ ${color white}ClamAV/g' "$chroot_path/etc/skel/.conkyrc" - - chroot_clean "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # 8. Manuelle Aktionen - deaktiviert - - #echo "Now You Have TIME to do something MANUALY!" - #echo "enter in shell: #> chroot $chroot_path /bin/bash" - #chroot $chroot_path /bin/bash - #echo "Are You Finisch? Then Press [ENTER]" - - #config xrdp to start xfce - echo '#!/bin/sh' > "$chroot_path"/etc/xrdp/startwm.sh - echo "export LANG=\"de_DE.UTF-8\"" >> "$chroot_path"/etc/xrdp/startwm.sh - echo "startxfce4" >> "$chroot_path"/etc/xrdp/startwm.sh - - # 9. Umount - Chroot Umgebung auflösen - - chroot_umount "$chroot_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - #Überprüfen ob alles ausgehängt wurde - [ "`chroot_is_mounted "$chroot_path"`" == "true" ] && { - echo "### ERROR ### Cant Unmount Chroot!" >> "$log_file" - on_exit 21 >> "$log_file" - } - - # 10. Packen und Ersetzen der Dateien des Live-Systems - rm "$filesystem_img" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - filesystem_pack "$chroot_path" "$filesystem_img" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - # wenn iso gewünscht - [ "$iso_aim" != "" ] && { - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - } - - # wenn filesystem gewünscht - [ "$squashfs_path" != "" ] && { - #wen bereits forhanden dann löschen - [ -f "$squashfs_path" ] && rm "$squashfs_path" - cp "$filesystem_img" "$squashfs_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - chmod 666 "$squashfs_path" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - } - - chmod 666 "$iso_aim" "$filesystem_img" >> "$log_file" - - workspace_erase "$iso_extr_dir/" "$chroot_path/" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - - - on_exit 0 -} - ##################################################################################### ################## F u n c t i o n s ################################################ ##################################################################################### @@ -286,5 +120,162 @@ source /proj/desinfect.17 ########################################################### ################# P r o c e s s ... ####################### ########################################################### -#wenn kein modus angegebnen: default modus -main_renew + +#Start LOG +tail -f "$log_file" --pid="$$" & + +chroot_path="`mktemp -d`" +iso_extr_dir="`mktemp -d`" + +echo "Remaster LOG `date '+%Y-%m-%d'`" > "$log_file" +echo "MODE: renew" >> "$log_file" +echo "HOST: `hostname`" >> "$log_file" +echo >> "$log_file" + +echo "### S e t t i n g s ###" >> "$log_file" +echo "#CD/DVD" >> "$log_file" +echo "iso_source=\"$iso_source\"" >> "$log_file" +echo "iso_aim=\"$iso_aim\"" >> "$log_file" +echo "iso_lable=\"$iso_lable\"" >> "$log_file" +echo >> "$log_file" + +echo "#Filesystem (for pxe)" >> "$log_file" +echo "squashfs_path=\"$squashfs_path\"" >> "$log_file" +echo >> "$log_file" + +echo "#Network" >> "$log_file" +echo "proxy_host=\"$proxy_host\"" >> "$log_file" +echo "proxy_port=\"$proxy_port\"" >> "$log_file" +echo "domain=\"$domain\"" >> "$log_file" +echo "nameserver=\"$nameserver\"" >> "$log_file" +echo >> "$log_file" + +echo "#remaster_script" >> "$log_file" +echo "project=\"$project\"" >> "$log_file" +echo >> "$log_file" + +echo "log_file=\"$log_file\"" +echo "log_mail_aim=\"$log_mail_aim\"" +echo "log_mail_subject=\"$log_mail_subj >> "$log_file"ect\"" +echo "" + +echo "#Sonstiges" >> "$log_file" +echo "tools_list=\"$tools_list\"" >> "$log_file" +echo $'\n' >> "$log_file" + +echo "### Enviroment ###" +echo "iso_extr_dir=\"$iso_extr_dir\"" >> "$log_file" +echo "chroot_path=\"$chroot_path\"" >> "$log_file" +#env >> "$log_file" +echo $'\n\n' >> "$log_file" + +echo $'### R U N ... ###\n' >> "$log_file" + +#1. Set and Check Enviroment +check_user >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +check_dependency >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +check_config >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +check_update >> "$log_file" + +# 2. Entpacke ISO +iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" + +# 3. Entpacken der Dateien des Live-Systems +filesystem_img="`find "$iso_extr_dir" -name filesystem.squashfs`" +[ -e "$filesystem_img" ] || { + echo "### ERROR ### Image \"$iso_source\" has no \"filesystem.squashfs\"" >> "$log_file" + on_exit 15 >> "$log_file" +} + +filesystem_extract "$filesystem_img" "$chroot_path" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +# 4. Vorbereiten für chroot-Umgebung: + +chroot_initial "$chroot_path" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +# 5. Setzen der Netzwerk-Einstellungen: +[ -n "$proxy_host" ] && { + proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" +} + +dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +# 6. Updaten von Desinfec't: +os_update "$chroot_path" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +# 7. Installation optionaler Tools: + +tools_add "$chroot_path" "$tools_list" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +#addo ClamAV to conky_info +sed -i 's/# ${color white}ClamAV/ ${color white}ClamAV/g' "$chroot_path/etc/skel/.conkyrc" + +chroot_clean "$chroot_path" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +# 8. Manuelle Aktionen - deaktiviert + +#echo "Now You Have TIME to do something MANUALY!" +#echo "enter in shell: #> chroot $chroot_path /bin/bash" +#chroot $chroot_path /bin/bash +#echo "Are You Finisch? Then Press [ENTER]" + +#config xrdp to start xfce +echo '#!/bin/sh' > "$chroot_path"/etc/xrdp/startwm.sh +echo "export LANG=\"de_DE.UTF-8\"" >> "$chroot_path"/etc/xrdp/startwm.sh +echo "startxfce4" >> "$chroot_path"/etc/xrdp/startwm.sh + +# 9. Umount - Chroot Umgebung auflösen + +chroot_umount "$chroot_path" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +#Überprüfen ob alles ausgehängt wurde +[ "`chroot_is_mounted "$chroot_path"`" == "true" ] && { + echo "### ERROR ### Cant Unmount Chroot!" >> "$log_file" + on_exit 21 >> "$log_file" +} + +# 10. Packen und Ersetzen der Dateien des Live-Systems +rm "$filesystem_img" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +filesystem_pack "$chroot_path" "$filesystem_img" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + +# wenn iso gewünscht +[ "$iso_aim" != "" ] && { + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" +} + +# wenn filesystem gewünscht +[ "$squashfs_path" != "" ] && { + #wen bereits forhanden dann löschen + [ -f "$squashfs_path" ] && rm "$squashfs_path" + cp "$filesystem_img" "$squashfs_path" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + + chmod 666 "$squashfs_path" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" +} + +chmod 666 "$iso_aim" "$filesystem_img" >> "$log_file" + +workspace_erase "$iso_extr_dir/" "$chroot_path/" >> "$log_file" +error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + + +on_exit 0 From cd15118bb8d3ee8a1ea60280c42bc81979da12cc Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:17:02 +0200 Subject: [PATCH 47/55] beautysh -f src/remaster.sh --- src/remaster.sh | 72 ++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/remaster.sh b/src/remaster.sh index e4fe7b1..5230919 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -10,37 +10,37 @@ #set functions [ -d "" ] || { - echo "ERROR Librarys not found" - exit 1 + echo "ERROR Librarys not found" + exit 1 } #read main setting if [ -f "/etc/remaster/config.cfg" ]; then - source "/etc/remaster/config.cfg" + source "/etc/remaster/config.cfg" else - if [ -f "/etc/remaster/config.sample.cfg" ]; then - source "/etc/remaster/config.sample.cfg" - else - echo "ERROR config not found" - exit 1 - fi + if [ -f "/etc/remaster/config.sample.cfg" ]; then + source "/etc/remaster/config.sample.cfg" + else + echo "ERROR config not found" + exit 1 + fi fi #check LOG { - [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" + [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" - if [ -f "$log_file" ]; then - echo > "$log_file" - else - #check if folder exist - [ -d "${log_file%/*}" ] || { - # N-> exit 3 - echo "Directory for Log didnt exist" - exit 3 - } - #create LOG - touch "$log_file" - fi + if [ -f "$log_file" ]; then + echo > "$log_file" + else + #check if folder exist + [ -d "${log_file%/*}" ] || { + # N-> exit 3 + echo "Directory for Log didnt exist" + exit 3 + } + #create LOG + touch "$log_file" + fi } ##################################################################################### @@ -189,8 +189,8 @@ iso_extract "$iso_source" "$iso_extr_dir" >> "$log_file" # 3. Entpacken der Dateien des Live-Systems filesystem_img="`find "$iso_extr_dir" -name filesystem.squashfs`" [ -e "$filesystem_img" ] || { - echo "### ERROR ### Image \"$iso_source\" has no \"filesystem.squashfs\"" >> "$log_file" - on_exit 15 >> "$log_file" + echo "### ERROR ### Image \"$iso_source\" has no \"filesystem.squashfs\"" >> "$log_file" + on_exit 15 >> "$log_file" } filesystem_extract "$filesystem_img" "$chroot_path" >> "$log_file" @@ -203,8 +203,8 @@ error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_fil # 5. Setzen der Netzwerk-Einstellungen: [ -n "$proxy_host" ] && { - proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + proxy_enable "$chroot_path" "$proxy_host" "$proxy_port" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } dns_set "$chroot_path" "$domain" "$nameserver" >> "$log_file" @@ -244,8 +244,8 @@ error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_fil #Überprüfen ob alles ausgehängt wurde [ "`chroot_is_mounted "$chroot_path"`" == "true" ] && { - echo "### ERROR ### Cant Unmount Chroot!" >> "$log_file" - on_exit 21 >> "$log_file" + echo "### ERROR ### Cant Unmount Chroot!" >> "$log_file" + on_exit 21 >> "$log_file" } # 10. Packen und Ersetzen der Dateien des Live-Systems @@ -257,19 +257,19 @@ error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_fil # wenn iso gewünscht [ "$iso_aim" != "" ] && { - iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + iso_create "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } # wenn filesystem gewünscht [ "$squashfs_path" != "" ] && { - #wen bereits forhanden dann löschen - [ -f "$squashfs_path" ] && rm "$squashfs_path" - cp "$filesystem_img" "$squashfs_path" >> "$log_file" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + #wen bereits forhanden dann löschen + [ -f "$squashfs_path" ] && rm "$squashfs_path" + cp "$filesystem_img" "$squashfs_path" >> "$log_file" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - chmod 666 "$squashfs_path" - error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" + chmod 666 "$squashfs_path" + error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" } chmod 666 "$iso_aim" "$filesystem_img" >> "$log_file" From f303797810a9161224ed2650208cbe4d7a026f96 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:20:55 +0200 Subject: [PATCH 48/55] add new base function --- src/proj/base | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/proj/base b/src/proj/base index 6e03c0d..e33b145 100755 --- a/src/proj/base +++ b/src/proj/base @@ -28,3 +28,7 @@ function proxy_enable() { function dns_set() { echo "$project: dns_set ot available" } + +function project_mods() { + echo "$project: project_mods ot available" +} From 23e39f21f6509e6448e72f5ec7755405aa55e81c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:25:13 +0200 Subject: [PATCH 49/55] readd proj mods --- src/proj/desinfect.17 | 11 +++++++++++ src/remaster.sh | 5 +---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/proj/desinfect.17 b/src/proj/desinfect.17 index 18c99f3..355e2e4 100755 --- a/src/proj/desinfect.17 +++ b/src/proj/desinfect.17 @@ -250,3 +250,14 @@ function tools_add-desinfect.17() { sourcelist_desinfect_set_nomal2017 "$chroot_dir" } function tools_add() { tools_add-desinfect.17 $@; } + + +function project_mods-desinfect.17() { + #config xrdp to start xfce + [ -d "$chroot_path/etc/xrdp/" ] && { + echo '#!/bin/sh' > "$chroot_path"/etc/xrdp/startwm.sh + echo "export LANG=\"de_DE.UTF-8\"" >> "$chroot_path"/etc/xrdp/startwm.sh + echo "startxfce4" >> "$chroot_path"/etc/xrdp/startwm.sh + } +} +function project_mods() { project_mods-desinfect.17 $@; } diff --git a/src/remaster.sh b/src/remaster.sh index 5230919..a2e8e5c 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -232,10 +232,7 @@ error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_fil #chroot $chroot_path /bin/bash #echo "Are You Finisch? Then Press [ENTER]" -#config xrdp to start xfce -echo '#!/bin/sh' > "$chroot_path"/etc/xrdp/startwm.sh -echo "export LANG=\"de_DE.UTF-8\"" >> "$chroot_path"/etc/xrdp/startwm.sh -echo "startxfce4" >> "$chroot_path"/etc/xrdp/startwm.sh +project_mods # 9. Umount - Chroot Umgebung auflösen From 7d4c1015d58b9038a49ce926b55b80ac35721e34 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:30:35 +0200 Subject: [PATCH 50/55] switch checks --- src/func/iso_extract | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/func/iso_extract b/src/func/iso_extract index ab6c6df..e5100f7 100755 --- a/src/func/iso_extract +++ b/src/func/iso_extract @@ -15,17 +15,18 @@ function iso_extract() { return 10 } + iso_extr_dir="$2" + [ -d "$iso_extr_dir" ] || { + echo "### ERROR ### iso_extract: aim directory not exist!" + return 12 + } + iso_source="$1" [ -f "$iso_source" ] || { echo "### ERROR ### iso_extract: ISO \"$iso_source\" not exist!" return 11 } - iso_extr_dir="$2" - [ -d "$iso_extr_dir" ] || { - echo "### ERROR ### iso_extract: aim directory not exist!" - return 12 - } #mace tmp mountpoint tmpdir="`mktemp -d`" From 2a081ad5175e835ef079cc90043297b8de3950f0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:34:32 +0200 Subject: [PATCH 51/55] add logic --- src/func/iso_extract | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/func/iso_extract b/src/func/iso_extract index e5100f7..46a8432 100755 --- a/src/func/iso_extract +++ b/src/func/iso_extract @@ -21,10 +21,17 @@ function iso_extract() { return 12 } + iso_source_is_url=false iso_source="$1" [ -f "$iso_source" ] || { - echo "### ERROR ### iso_extract: ISO \"$iso_source\" not exist!" - return 11 + #if it is an url... + if [ url-exist ]; then + iso_source_is_url=true + #dl to tmp + set iso_source + else + echo "### ERROR ### iso_extract: ISO \"$iso_source\" not exist!" + return 11 + fi } @@ -42,6 +49,7 @@ function iso_extract() { #clear tmp mountpoint umount "$iso_source" rm -r "$tmpdir" + [ "$iso_source_is_url" == "true" ] && rm "$iso_source" tmpdir= echo "done" From 05bf2a4cdf6d0abfeac3043b73bf081f37cca164 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:38:30 +0200 Subject: [PATCH 52/55] add new sub func --- src/func/check_url | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/func/check_url diff --git a/src/func/check_url b/src/func/check_url new file mode 100644 index 0000000..53b23e0 --- /dev/null +++ b/src/func/check_url @@ -0,0 +1,20 @@ +#!/bin/bash +#remaster lib +[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } + +#check_url [URL] +function check_url() { + URL="$1" + if [[ `wget -S --spider "$URL" 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then + echo "true" + return 0 + else + echo "false" + return 1 + fi +} + +#this func is standalone executable +[ -n "$1" ] && { + check_url $@ +} From 32cfb2a7a43381d1ba45a106e95a2b62ea357f60 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:47:10 +0200 Subject: [PATCH 53/55] finish --- src/func/iso_extract | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/func/iso_extract b/src/func/iso_extract index 46a8432..d89ff28 100755 --- a/src/func/iso_extract +++ b/src/func/iso_extract @@ -21,13 +21,13 @@ function iso_extract() { return 12 } - iso_source_is_url=false iso_source="$1" [ -f "$iso_source" ] || { #if it is an url... - if [ url-exist ]; then - iso_source_is_url=true + if [ "`check_url $iso_source`" == "true" ]; then #dl to tmp + set iso_source + iso_tmp="`mktemp --suffix=.iso`"; rm "$iso_tmp" + wget -O "$iso_tmp" "$iso_source" else echo "### ERROR ### iso_extract: ISO \"$iso_source\" not exist!" return 11 @@ -49,7 +49,7 @@ function iso_extract() { #clear tmp mountpoint umount "$iso_source" rm -r "$tmpdir" - [ "$iso_source_is_url" == "true" ] && rm "$iso_source" + [ -n "$iso_tmp" ] && rm "$iso_tmp" tmpdir= echo "done" From aa0e1fbd6da7ad120afaf9633754436790bd4d67 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 01:51:17 +0200 Subject: [PATCH 54/55] v 2.0.4 --- DEBIAN/control | 2 +- changes/remaster.md | 6 ++++++ src/remaster.sh | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DEBIAN/control b/DEBIAN/control index 132f7d0..0862434 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -1,6 +1,6 @@ Package: remaster Source: remaster -Version: 2.0.3 +Version: 2.0.4 Architecture: all Maintainer: 6543 <6543@obermui.de> Installed-Size: diff --git a/changes/remaster.md b/changes/remaster.md index d5f582d..7a6a57d 100644 --- a/changes/remaster.md +++ b/changes/remaster.md @@ -24,3 +24,9 @@ * change Strukture.md * add config check * some help scripts + +2018-05-22 - 2.0.4 + * add iso_source as URL + * restructure code + * use proj templates + * some help scripts diff --git a/src/remaster.sh b/src/remaster.sh index a2e8e5c..0d5558f 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -1,7 +1,7 @@ #!/bin/bash -#@version 2.0.3 +#@version 2.0.4 #@autor 6543@obermui.de -#@date 2018-05-20 +#@date 2018-05-22 #@licence GNUv3 ##################################################################################### From de495758b48b2392d972ef11bf103ec9c2429e7c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 22 May 2018 02:19:04 +0200 Subject: [PATCH 55/55] del old proj for release --- src/proj/desinfect.15 | 227 ------------------------------------ src/proj/desinfect.16 | 262 ------------------------------------------ 2 files changed, 489 deletions(-) delete mode 100755 src/proj/desinfect.15 delete mode 100755 src/proj/desinfect.16 diff --git a/src/proj/desinfect.15 b/src/proj/desinfect.15 deleted file mode 100755 index 02302d7..0000000 --- a/src/proj/desinfect.15 +++ /dev/null @@ -1,227 +0,0 @@ -#!/bin/bash -#remaster lib -[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } - -#desinfect.15 -# . -Y ubuntu.14.04 -> ubuntu -> debian -source /proj/ubuntu.14.04 -project_relation="desinfect.15 $project_relation" - - - -#iso_create-desinfect.15 [chroot_path] [iso_extr_dir] [iso_aim] [iso_lable] -function iso_create-desinfect.15() { - echo "prepere iso folder ... " - - chroot_path="$1" - iso_extr_dir="$2" - iso_aim="$3" - iso_lable="$4" - - #desinfect - rm "$iso_extr_dir/casper/initrd.lz" - wget http://www.heise.de/ct/projekte/desinfect/des15/initrd.lz -O "$iso_extr_dir/casper/initrd.lz" - - echo "done" - - iso_create-debian "$chroot_path" "$iso_extr_dir" "$iso_aim" "$iso_lable" -} -function iso_create() { iso_create-desinfect.15 $@; } - -#chroot_initial-desinfect.15 [chroot_dir] -function chroot_initial-desinfect.15() { - #$1 = chroot dir - - chroot_initial-debian "$1" - - echo -n "initial desinfect on chroot ... " - - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_initial_desinfect: chroot directory not exist!" - return 12 - } - - #mount virus definitions - #bitdefender - mount --bind $chroot_dir/opt/BitDefender-scanner/var/lib/scan{.orig,} - mount --bind $chroot_dir/var/kl/bases_rd{.orig,} - - echo "done" -} -function iso_create() { iso_create-desinfect.15 $@; } - -#chroot_umount-desinfect.15 [chroot_dir] -function chroot_umount-desinfect.15() { - #call main mount - chroot_umount-debian "$1" - - echo -n "unmount desinfect on chroot ... " - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" - return 12 - } - - for d in "$chroot_dir/opt/BitDefender-scanner/var/lib/scan" "$chroot_dir/var/kl/bases_rd" ; do - umount $d - retval=$? - [ "$retval" -gt 0 ] && { - echo "### ERROR ### chroot_umount_desinfect: can't umount \"$d\"!" - return 21 - } - done - - echo "done" -} -function chroot_umount() { chroot_umount-desinfect.15 $@; } - -#proxy_enable-desinfect.15 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable-desinfect.15() { - - proxy_enable-debian $1 $2 $3 - - echo -n "enable proxy for desinfect's av ... " - - chroot_dir="$1" - proxy_host="$2" - proxy_port="$3" - - #Avast AntiVirus - sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - - #BitDefender - echo "ProxyEnable = Yes" >> "$chroot_dir/etc/BitDefender-scanner/bdscan.conf" - echo "ProxyHost = $proxy_host:$proxy_port" >> "$chroot_dir/etc/BitDefender-scanner/bdscan.conf" - - #Clam AV - echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" - echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" - - #Kaspersky - sed -i "s/0<\/tDWORD>/1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tSTRING>/$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tDWORD>/$proxy_port<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - - echo "done" -} -function proxy_enable() { proxy_enable-desinfect.15 $@; } - -#sourcelist_desinfect_set_nomal2015 [chroot_dir] -function sourcelist_desinfect_set_nomal2015() { - echo -n "build normal source.list ... " - #$1 = chroot directory - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2015 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2015 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "# #### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "# ## developers who want to ship their latest software." >> "$sourcelist" - echo "# deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_extendet2015 [chroot_dir] -function sourcelist_desinfect_set_extendet2015() { - echo -n "build extendet source.list ... " - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2015 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2015 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "#### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "## developers who want to ship their latest software." >> "$sourcelist" - echo "deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#os_update-desinfect.15 [chroot_dir] -function os_update-desinfect.15() { - #$1 = chroot directory - - chroot_dir="$1" - - #call main os_update - os_update-debian "$chroot_dir" - - echo "update virus definitions ... " - - #BitDefender - chroot "$chroot_dir" /bin/bash -c "bdscan --update" | grep -v "... updated" - - #Avast Avira - chroot "$chroot_dir" /bin/bash -c "/AntiVirUpdate/avupdate" | grep -v " -> " - - #Clam AV - chroot "$chroot_dir" /bin/bash -c "freshclam" > /dev/null - rm -f "$chroot_dir/var/lib/clamav/daily.cld" - - #Karspersky - echo '#!/bin/bash' > "$chroot_dir/tmp/up_kasp" - echo 'PATH=/usr/lib/kl:$PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'LD_LIBRARY_PATH=/usr/lib/kl:$LD_LIBRARY_PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'KL_PLUGINS_PATH=/usr/lib/kl' >> "$chroot_dir/tmp/up_kasp" - echo 'export PATH LD_LIBRARY_PATH KL_PLUGINS_PATH' >> "$chroot_dir/tmp/up_kasp" - echo '/usr/lib/kl/kav update' >> "$chroot_dir/tmp/up_kasp" - chmod +x "$chroot_dir/tmp/up_kasp" - chroot "$chroot_dir" /bin/bash -c "/tmp/up_kasp" | grep -v ".kdc" | grep -v "File downloaded" - rm "$chroot_dir/tmp/up_kasp" - - - echo "done" -} -function os_update() { os_update-desinfect.15 $@; } - -#tools_add-desinfect.15 [chroot_dir] [tools_list] -function tools_add-desinfect.15() { - #$1 = chroot directory - chroot_dir="$1" - tools_list="$2" - - sourcelist_desinfect_set_extendet2015 "$chroot_dir" - tools_add-debian "$chroot_dir" "$tools_list" - sourcelist_desinfect_set_nomal2015 "$chroot_dir" -} -function tools_add() { tools_add-desinfect.15 $@; } diff --git a/src/proj/desinfect.16 b/src/proj/desinfect.16 deleted file mode 100755 index 89e5d5a..0000000 --- a/src/proj/desinfect.16 +++ /dev/null @@ -1,262 +0,0 @@ -#!/bin/bash -#remaster lib -[ -d "" ] || { echo "LIBDIR not exist"; exit 1; } - -#desinfect.16 -# . -Y ubuntu.14.04 -> ubuntu -> debian -source /proj/ubuntu.14.04 -project_relation="desinfect.16 $project_relation" - - -#chroot_initial-desinfect.16 [chroot_dir] -function chroot_initial-desinfect.16() { - #$1 = chroot dir - - chroot_initial-debian "$1" - - echo -n "initial desinfect on chroot ... " - - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_initial_desinfect: chroot directory not exist!" - return 12 - } - - #mount virus definitions - mount --bind $chroot_dir/var/kl/bases_rd{.orig,} - - echo "done" -} -function chroot_initial() { chroot_initial-desinfect.16 $@; } - -#chroot_umount-desinfect.16 [chroot_dir] -function chroot_umount-desinfect.16() { - #call main mount - chroot_umount-debian "$1" - - echo -n "unmount desinfect on chroot ... " - #check chroot dir - chroot_dir="$1" - [ -d "$chroot_dir" ] || { - echo "### ERROR ### chroot_umount_desinfect: chroot directory not exist!" - return 12 - } - - umount "$chroot_dir/var/kl/bases_rd" - [ "$?" -gt 0 ] && { - echo "### ERROR ### chroot_umount_desinfect: can't umount \"$chroot_dir/var/kl/bases_rd\"!" - #return 21 - } - - echo "done" -} -function chroot_umount() { chroot_umount-desinfect.16 $@; } - -#proxy_enable-desinfect.16 [chroot_dir] [proxy_host] [proxy_port] -function proxy_enable-desinfect.16() { - - proxy_enable-debian $1 $2 $3 - - echo -n "enable proxy for desinfect's av ... " - - chroot_dir="$1" - proxy_host="$2" - proxy_port="$3" - tmp_file_344532="`mktemp`" - - #Avast AntiVirus - sed -i "s/--skip-master-file/--skip-master-file --proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - sed -i "s/--proxy-host=$proxy_host --proxy-port=$proxy_port --proxy-host=$proxy_host --proxy-port=$proxy_port/--proxy-host=$proxy_host --proxy-port=$proxy_port/g" "$chroot_dir/AntiVirUpdate/avupdate" - - #Clam AV - cat "$chroot_dir/etc/clamav/freshclam.conf" | grep -v "HTTPProxyServer" | grep -v "HTTPProxyPort" > "$tmp_file_344532" - rm "$chroot_dir/etc/clamav/freshclam.conf" - cp "$tmp_file_344532" "$chroot_dir/etc/clamav/freshclam.conf" - - echo "HTTPProxyServer $proxy_host" >> "$chroot_dir/etc/clamav/freshclam.conf" - echo "HTTPProxyPort $proxy_port" >> "$chroot_dir/etc/clamav/freshclam.conf" - - #Eset AV - cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "proxy_addr" | grep -v "proxy_port" > "$tmp_file_344532" - rm "$chroot_dir/etc/opt/eset/esets/esets.cfg" - cp "$tmp_file_344532" "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - echo "proxy_addr = \"$proxy_host\"" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - echo "proxy_port = $proxy_port" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - #Kaspersky - sed -i "s/0<\/tDWORD>/1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tSTRING>/$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml" - sed -i "s/<\/tDWORD>/$proxy_port<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml" - - rm "$tmp_file_344532" - tmp_file_344532= - - echo "done" -} -function proxy_enable() { proxy_enable-desinfect.16 $@; } - -#sourcelist_desinfect_set_nomal2016 [chroot_dir] -function sourcelist_desinfect_set_nomal2016() { - echo -n "build normal source.list ... " - #$1 = chroot directory - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2016 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2016 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "# #### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "# deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "#" >> "$sourcelist" - echo "# ## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "# ## developers who want to ship their latest software." >> "$sourcelist" - echo "# deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#sourcelist_desinfect_set_extendet2016 [chroot_dir] -function sourcelist_desinfect_set_extendet2016() { - echo -n "build extendet source.list ... " - - sourcelist="$1/etc/apt/sources.list" - - - echo "#### Desinfe't 2016 ####" > "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://www.heise.de/ct/projekte/desinfect/ubuntu 2016 main" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "#### Ubuntu 14.04 (trusty) ####" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "deb http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "deb-src http://de.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> "$sourcelist" - echo "" >> "$sourcelist" - echo "## This software is not part of Ubuntu, but is offered by third-party" >> "$sourcelist" - echo "## developers who want to ship their latest software." >> "$sourcelist" - echo "deb http://extras.ubuntu.com/ubuntu trusty main" >> "$sourcelist" - - echo "done" -} - -#os_update-desinfect.16 [chroot_dir] -function os_update-desinfect.16() { - #$1 = chroot directory - - chroot_dir="$1" - - #call main os_update - os_update-debian "$chroot_dir" - - echo "update virus definitions ... " - - #Avast Avira - { - echo "Avira ..." - chroot "$chroot_dir" /bin/bash -c "/AntiVirUpdate/avupdate" | grep -v " -> " - echo "Avira done" - } - - #Clam AV - { - echo "ClamAV..." - chroot "$chroot_dir" /bin/bash -c "freshclam" > /dev/null - rm -f "$chroot_dir/var/lib/clamav/daily.cld" - echo "ClamAV done" - } - - #Eset AV - { - echo "Eset AV ..." - tmp_file_23421="`mktemp`" - cat "$chroot_dir/etc/opt/eset/esets/esets.cfg" | grep -v "av_update_username" | grep -v "av_update_password" > "$tmp_file_23421" - cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" - chroot "$chroot_dir" /bin/bash -c "/usr/bin/esetrand" >> "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - echo "set timeout: 2min" - av_eaet_timeout=1200 - tmp_var_3092="`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" - - #eig. update routine - chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets restart" - sleep 2 - chroot "$chroot_dir" /bin/bash -c "/opt/eset/esets/sbin/esets_daemon --update" - - #warten auf daemon update ... - sleep 10m - echo "wait 10min for Eset AV update" - while [ "`chroot "$chroot_dir" /bin/bash -c "/opt/desinfect/conky_info.sh eset"`" == "$tmp_var_3092" ]; do - sleep 1 - av_eaet_timeout=$((av_eaet_timeout-1)) - [ $av_eaet_timeout -gt 0 ] || tmp_var_3092= - done - - sleep 4 - - chroot "$chroot_dir" /bin/bash -c "/etc/init.d/esets stop" - - cat "$tmp_file_23421" > "$chroot_dir/etc/opt/eset/esets/esets.cfg" - - rm "$tmp_file_23421" - tmp_file_23421= - tmp_var_3092= - echo "Eset AV done" - } - - #Karspersky - { - echo "Karspersky ..." - #gen update-scrypt - echo '#!/bin/bash' > "$chroot_dir/tmp/up_kasp" - echo 'PATH=/usr/lib/kl:$PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'LD_LIBRARY_PATH=/usr/lib/kl:$LD_LIBRARY_PATH' >> "$chroot_dir/tmp/up_kasp" - echo 'KL_PLUGINS_PATH=/usr/lib/kl' >> "$chroot_dir/tmp/up_kasp" - echo 'export PATH LD_LIBRARY_PATH KL_PLUGINS_PATH' >> "$chroot_dir/tmp/up_kasp" - echo '/usr/lib/kl/kav update' >> "$chroot_dir/tmp/up_kasp" - chmod +x "$chroot_dir/tmp/up_kasp" - - chroot "$chroot_dir" /bin/bash -c "/tmp/up_kasp" | grep -v ".kdc" | grep -v "File downloaded" - rm "$chroot_dir/tmp/up_kasp" - echo "Karspersky done" - } - - echo "update virus definitions done" -} -function os_update() { os_update-desinfect.16 $@; } - -#tools_add-desinfect.16 [chroot_dir] [tools_list] -function tools_add-desinfect.16() { - #$1 = chroot directory - chroot_dir="$1" - tools_list="$2" - - sourcelist_desinfect_set_extendet2016 "$chroot_dir" - tools_add-debian "$chroot_dir" "$tools_list" - sourcelist_desinfect_set_nomal2016 "$chroot_dir" -} -function tools_add() { tools_add-desinfect.16 $@; }