Compare commits
26 Commits
feature-lx
...
v2.1.0
Author | SHA1 | Date | |
---|---|---|---|
70c002bff2
|
|||
9fbdea3a1d | |||
7fd11f9cd6
|
|||
d34f7a39bd
|
|||
1af13587dc | |||
e0262554ce | |||
0caa4f6af2
|
|||
67be4705a5
|
|||
2a3aa53d2f | |||
df734f1f34
|
|||
2ac2fd9cd2
|
|||
90926de1d6
|
|||
189fd6d56c
|
|||
ff5d90c312
|
|||
ade9e795b6
|
|||
e26f391b49
|
|||
3643b745ae
|
|||
f5db5a154d
|
|||
3149285ab9
|
|||
db0ae5e4fe
|
|||
18b42628a0 | |||
ffdab66b35 | |||
de495758b4 | |||
1a301100b7 | |||
263587222e | |||
c9116e1cfd |
@ -30,3 +30,13 @@
|
|||||||
* restructure code
|
* restructure code
|
||||||
* use proj templates
|
* use proj templates
|
||||||
* some help scripts
|
* some help scripts
|
||||||
|
|
||||||
|
2019-09-20 - 2.1.0
|
||||||
|
* fixes
|
||||||
|
- filesystem_extract: filesystem_get_type
|
||||||
|
- update dev scripts
|
||||||
|
- work without arguments
|
||||||
|
* check_update: acuret message
|
||||||
|
* restruct sample config
|
||||||
|
* add "Help & Info" menue/section (#24) (#20)
|
||||||
|
* --config | custom config (#25)
|
@ -1,6 +1,6 @@
|
|||||||
Package: remaster
|
Package: remaster
|
||||||
Source: remaster
|
Source: remaster
|
||||||
Version: 2.0.4
|
Version: 2.1.0
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Maintainer: 6543 <6543@obermui.de>
|
Maintainer: 6543 <6543@obermui.de>
|
||||||
Installed-Size: <SIZE>
|
Installed-Size: <SIZE>
|
||||||
|
10
README.md
10
README.md
@ -1,5 +1,9 @@
|
|||||||
# remaster
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
||||||
|
[](https://github.com/6543/remaster/releases/latest)
|
||||||
|
[](https://mh.obermui.de/publickey.gpg)
|
||||||
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2F6543%2Fremaster?ref=badge_shield)
|
||||||
|
|
||||||
|
# remaster
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@ -30,3 +34,7 @@ The aim of this Project is to create a daemon for a server, witch update live sy
|
|||||||
- Ubuntu/Debian
|
- Ubuntu/Debian
|
||||||
- Desinfect17
|
- Desinfect17
|
||||||
- one config file
|
- one config file
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2F6543%2Fremaster?ref=badge_large)
|
||||||
|
@ -9,16 +9,17 @@ date=`date +%Y-%m-%d`
|
|||||||
|
|
||||||
#nummer
|
#nummer
|
||||||
sed -i "/#@version\ /c\#@version\ $version_sed" src/remaster.sh
|
sed -i "/#@version\ /c\#@version\ $version_sed" src/remaster.sh
|
||||||
|
sed -i "/echo\ Remaster\ /c\ \ \ \ \ \ \ \ \ \ echo\ Remaster\ $version_sed" src/remaster.sh
|
||||||
|
|
||||||
#datum
|
#datum
|
||||||
sed -i "/#@date\ /c\#@date\ $date" src/remaster.sh
|
sed -i "/#@date\ /c\#@date\ $date" src/remaster.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -e "changes/remaster.md" ] && {
|
[ -e "Changelog.md" ] && {
|
||||||
|
|
||||||
echo >> changes/remaster.md
|
echo >> Changelog.md
|
||||||
echo $date - $version >> changes/remaster.md
|
echo $date - $version >> Changelog.md
|
||||||
editor changes/remaster.md
|
$EDITOR Changelog.md
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -f "DEBIAN/control" ] && {
|
[ -f "DEBIAN/control" ] && {
|
||||||
|
@ -1,36 +1,39 @@
|
|||||||
#cfg
|
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
## sample-config rename it to config.cfg after changes ##
|
## sample-config rename it to config.cfg after changes ##
|
||||||
#########################################################
|
#########################################################
|
||||||
|
|
||||||
#CD/DVD
|
## Quelle der Project CD/DVD
|
||||||
#entweder iso_source oder squashfs_path alls quelle
|
iso_source="/data/local/Desinfect_Remaster/tmp/desinfect-2017.iso"
|
||||||
# -> bei iso gen erforderlich!
|
|
||||||
iso_source="/data/remaster/desinfect-2017.iso"
|
## Pfad zum gepakten Live System
|
||||||
#destination optinal
|
## (kann anstat einer ISO auch als Quelle dienen, dann aber auch zwingend als Ziel)
|
||||||
iso_aim="/data/remaster/result/custom_desinfect_`date '+%Y-%m-%d'`.iso"
|
# squashfs_path="/data/local/Desinfect_Remaster/tmp/filesystem.squashfs"
|
||||||
|
|
||||||
|
## Ziel, Lable der zu erstellenden CD/DVD
|
||||||
|
iso_aim="/data/local/Desinfect_Remaster/tmp/custom_desinfect_`date '+%Y-%m-%d'`.iso"
|
||||||
iso_lable="DESINFECT_`date '+%Y-%m-%d'`"
|
iso_lable="DESINFECT_`date '+%Y-%m-%d'`"
|
||||||
|
|
||||||
#Filesystem (for pxe)
|
|
||||||
#entweder iso_source oder squashfs_path alls quelle
|
|
||||||
squashfs_path="/data/remaster/result/filesystem.squashfs"
|
|
||||||
|
|
||||||
#Network
|
## Netzwerk Sinstellungen
|
||||||
proxy_host="proxy.local"
|
## Proxy:
|
||||||
proxy_port="8080"
|
# proxy_host="10.40.8.108"
|
||||||
domain="local"
|
# proxy_port="8080"
|
||||||
nameserver="10.x.x.2,10.x.x.1"
|
domain="fritz.box"
|
||||||
|
nameserver="10.40.255.254"
|
||||||
|
|
||||||
#remaster_script
|
## Project / Distro
|
||||||
|
## Aktuell unterstützt: debian; ubuntu; ubuntu.14.04; ubuntu.16.04; desinfect.17
|
||||||
project="desinfect.17"
|
project="desinfect.17"
|
||||||
|
|
||||||
#LOG
|
## LOG Einstellungen
|
||||||
log_file="/data/remaster/logs/`date '+%Y-%m-%d'`.log"
|
## log_file ist optionall
|
||||||
log_mail_source="desinfect@email.clocal"
|
log_file="/data/local/Desinfect_Remaster/tmp/logs/`date '+%Y-%m-%d'`.log"
|
||||||
log_mail_smtp="smtp.mail.local:25"
|
## Senden mit sendmail einen Report
|
||||||
log_mail_aim="6543@email.clocal"
|
# log_mail_source="desinfect@email.clocal"
|
||||||
log_mail_subject="Desinfect_Remaster"
|
# log_mail_smtp="smtp.mail.local:25"
|
||||||
|
# log_mail_aim="6543@email.clocal"
|
||||||
|
# log_mail_subject="Desinfect_Remaster"
|
||||||
|
|
||||||
#Sonstiges
|
#Sonstiges
|
||||||
tools_list="xrdp clamav nano htop nmon iftop tmux dsniff nmap openssh-server tightvncserver rsync e2fsprogs foremost gddrescue recoverjpeg safecopy sleuthkit testdisk arp-scan"
|
tools_list="xrdp clamav nano htop nmon iftop tmux dsniff nmap openssh-server tightvncserver rsync e2fsprogs foremost gddrescue recoverjpeg safecopy sleuthkit testdisk arp-scan"
|
||||||
|
35
src/func/clear_config
Executable file
35
src/func/clear_config
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#remaster lib
|
||||||
|
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
|
||||||
|
|
||||||
|
#check_config
|
||||||
|
function clear_config() {
|
||||||
|
|
||||||
|
## Source & Aim options
|
||||||
|
iso_source=
|
||||||
|
squashfs_path=
|
||||||
|
iso_aim=
|
||||||
|
iso_lable=
|
||||||
|
|
||||||
|
## network
|
||||||
|
proxy_host=
|
||||||
|
proxy_port=
|
||||||
|
domain=
|
||||||
|
nameserver=
|
||||||
|
|
||||||
|
## Project / Distro
|
||||||
|
project=
|
||||||
|
|
||||||
|
## LOG Settings
|
||||||
|
log_file=
|
||||||
|
log_mail_source=
|
||||||
|
log_mail_smtp=
|
||||||
|
log_mail_aim=
|
||||||
|
log_mail_subject=
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#this func is standalone executable
|
||||||
|
[ -n "$1" ] && {
|
||||||
|
clear_config $@
|
||||||
|
}
|
@ -1,227 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#remaster lib
|
|
||||||
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
|
|
||||||
|
|
||||||
#desinfect.15
|
|
||||||
# . -Y ubuntu.14.04 -> ubuntu -> debian
|
|
||||||
source <LIBDIR>/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/<tDWORD name=\"UseProxy\">0<\/tDWORD>/<tDWORD name=\"UseProxy\">1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml"
|
|
||||||
sed -i "s/<tSTRING name=\"ProxyHost\"><\/tSTRING>/<tSTRING name=\"ProxyHost\">$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml"
|
|
||||||
sed -i "s/<tDWORD name=\"ProxyPort\"><\/tDWORD>/<tDWORD name=\"ProxyPort\">$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 $@; }
|
|
@ -1,262 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#remaster lib
|
|
||||||
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
|
|
||||||
|
|
||||||
#desinfect.16
|
|
||||||
# . -Y ubuntu.14.04 -> ubuntu -> debian
|
|
||||||
source <LIBDIR>/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/<tDWORD name=\"UseProxy\">0<\/tDWORD>/<tDWORD name=\"UseProxy\">1<\/tDWORD>/g" "$chroot_dir/etc/kl/config.xml"
|
|
||||||
sed -i "s/<tSTRING name=\"ProxyHost\"><\/tSTRING>/<tSTRING name=\"ProxyHost\">$proxy_host<\/tSTRING>/g" "$chroot_dir/etc/kl/config.xml"
|
|
||||||
sed -i "s/<tDWORD name=\"ProxyPort\"><\/tDWORD>/<tDWORD name=\"ProxyPort\">$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 $@; }
|
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#@version 2.0.4
|
#@version 2.1.0
|
||||||
#@autor 6543@obermui.de
|
#@autor 6543@obermui.de
|
||||||
#@date 2018-05-22
|
#@date 2019-09-20
|
||||||
#@licence GNUv3
|
#@licence GNUv3
|
||||||
|
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
@ -43,6 +43,38 @@ fi
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
################## H e l p & I n f o ##############################################
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
case $(echo $1 | tr -d '-') in
|
||||||
|
'') ;;
|
||||||
|
version|V)
|
||||||
|
echo Remaster 2.1.0
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
config|c)
|
||||||
|
if [ -f "$2" ]; then
|
||||||
|
source <LIBDIR>/func/clear_config
|
||||||
|
source "$2"
|
||||||
|
else
|
||||||
|
echo "ERROR Config \"$2\" not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo 'Remaster update Live Systems'
|
||||||
|
echo ' more information at: https://github.com/6543/remaster/'
|
||||||
|
echo ''
|
||||||
|
echo ' --version|-V show current version'
|
||||||
|
echo ' --config|-c <config> run remaster with custom config'
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
################## F u n c t i o n s ################################################
|
################## F u n c t i o n s ################################################
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
|
Reference in New Issue
Block a user