You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
3.1 KiB
121 lines
3.1 KiB
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
DESC="Préparation du système pour compatibilité DIRECT, COW et TGZ."
|
|
|
|
set +u
|
|
[ -z "$GUEST_NAME" ] && GUEST_NAME=buster
|
|
set -u
|
|
|
|
|
|
updateUpgrade() {
|
|
vdn-ssh root@$GUEST_NAME "apt-get update; apt-get -y upgrade"
|
|
}
|
|
|
|
installModulesReseaux() {
|
|
|
|
# paquets problématiques retirés :
|
|
# rpcbind : le paramétrage ors de l'installation du paquet bloque
|
|
# nfs-common nfs-kernel-server
|
|
# quagga
|
|
|
|
DEBS="less ssh mingetty rsync net-tools haveged rng-tools dnsutils zerofree"
|
|
DEBS="$DEBS vim slirp"
|
|
DEBS="$DEBS sshfs psmisc bsdutils strace busybox-static"
|
|
DEBS="$DEBS tcpdump wireshark-gtk nmap"
|
|
DEBS="$DEBS manpages"
|
|
DEBS="$DEBS curlftpfs ftp curl dillo"
|
|
DEBS="$DEBS libapache2-mod-php apache2-doc"
|
|
DEBS="$DEBS xbase-clients"
|
|
DEBS="$DEBS lynx psmisc file strace lsof telnet links links2"
|
|
DEBS="$DEBS iputils-ping"
|
|
DEBS="$DEBS rsync dialog"
|
|
DEBS="$DEBS firefox-esr"
|
|
DEBS="$DEBS nautilus"
|
|
DEBS="$DEBS user-mode-linux"
|
|
DEBS="$DEBS openvpn"
|
|
DEBS="$DEBS proftpd isc-dhcp-server"
|
|
|
|
DEBS="$DEBS busybox-static debootstrap"
|
|
DEBS="$DEBS user-mode-linux"
|
|
|
|
DEBS="$DEBS vim-gtk gedit"
|
|
|
|
DEBS="$DEBS gpm vde2"
|
|
DEBS="$DEBS spice-vdagent"
|
|
DEBS="$DEBS gpm vde2"
|
|
DEBS="$DEBS gcc make autoconf uidmap pkg-config glib-2.0-dev \
|
|
glib-2.0 libglib2.0-dev dpkg-dev \
|
|
libcap-dev libcap2 libseccomp2 libseccomp-dev"
|
|
|
|
# TP Pascal :
|
|
DEBS="$DEBS john hashcat sqlmap php default-mysql-server"
|
|
|
|
echo "apt-get..."
|
|
vdn-ssh -t root@$GUEST_NAME "
|
|
export DEBIAN_FRONTEND=noninteractive;
|
|
export http_proxy=$http_proxy;
|
|
apt-get install -y $DEBS
|
|
"
|
|
# cas de lighttpd
|
|
vdn-ssh -t root@$GUEST_NAME "
|
|
export DEBIAN_FRONTEND=noninteractive;
|
|
export http_proxy=$http_proxy
|
|
apt-get install -y lighttpd
|
|
systemctl disable lighttpd
|
|
"
|
|
|
|
|
|
# disable services
|
|
|
|
# remove : nfs-kernel-server nfs-blkmap nfs-server
|
|
|
|
local l="ModemManager NetworkManager NetworkManager-dispatcher NetworkManager-wait-online anacron apparmor autovt@ bgpd dbus-fi.w1.wpa_supplicant1 dbus-org.freedesktop.Avahi dbus-org.freedesktop.ModemManager1 dbus-org.freedesktop.nm-dispatcher dbus-org.freedesktop.timesync1 getty@ hddtemp isisd lighttpd lm-sensors network-manager nmbd openbsd-inetd openvpn ospf6d ospfd pimd portmap pppd-dns ripd ripngd rpcbind rsync smbd speech-dispatcher syslog systemd-timesyncd udisks2 wpa_supplicant zebra uml-utilities apache2 proftpd isc-dhcp-server"
|
|
|
|
vdn-ssh -t root@$GUEST_NAME "for i in $l; do echo \"Disable \$i\"; systemctl disable \$i; done"
|
|
|
|
}
|
|
|
|
installAll() {
|
|
updateUpgrade
|
|
installModulesReseaux
|
|
}
|
|
|
|
run() {
|
|
|
|
. $VDN_PATH/bin/functions-scripts.sh
|
|
. $VDN_PATH/bin/functions-build.sh
|
|
|
|
setErrorHandler
|
|
echoStart
|
|
|
|
set -a
|
|
. $NETWORK_DIR/$GUEST_NAME.conf
|
|
set +a
|
|
|
|
GUEST_DIR=$VDN_PATH/distribs/guests/direct/$GUEST_SYS
|
|
|
|
echo "HDA=$VDN_PATH/files/$HDA"
|
|
|
|
#[ ! -e $VDN_PATH/files/$HDA ] && \
|
|
debootstrap
|
|
|
|
requireSshGuests $GUEST_NAME
|
|
|
|
set +u
|
|
[ -z "$http_proxy" ] && http_proxy="" || :
|
|
[ -z "$https_proxy" ] && https_proxy="" || :
|
|
set -u
|
|
|
|
installAll
|
|
|
|
cleanHistory $GUEST_NAME
|
|
|
|
vdn-halt $GUEST_NAME
|
|
|
|
unsetErrorHandler
|
|
echoDone
|
|
}
|
|
|