2022-12-22 17:25:05 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# Target DMZ
|
|
|
|
set -e
|
|
|
|
if [ -z $MILXCGUARD ] ; then exit 1; fi
|
|
|
|
DIR=`dirname $0`
|
|
|
|
cd `dirname $0`
|
|
|
|
|
|
|
|
# disable systemd-resolved which conflicts with nsd
|
|
|
|
echo "DNSStubListener=no" >> /etc/systemd/resolved.conf
|
|
|
|
systemctl stop systemd-resolved
|
|
|
|
|
2022-12-22 18:52:38 +01:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get update
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get remove -y apache2
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
2022-12-22 17:25:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Go KAZ !
|
|
|
|
# KAZ specific things
|
|
|
|
#installation de docker, docker-compose et on y fourre le user debian dans le groupe idoine
|
|
|
|
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io docker-compose docker-clean git apg curl sudo unzip rsync fuse-overlayfs
|
|
|
|
usermod -G docker debian
|
|
|
|
# activation dans alias dans /root/.bashrc
|
|
|
|
sed -i \
|
|
|
|
-e 's/^\# alias/alias/g' \
|
|
|
|
-e 's/^\# export/export/g' \
|
|
|
|
-e 's/^\# eval/eval/g' \
|
|
|
|
/root/.bashrc
|
|
|
|
|
|
|
|
if ! grep -q "for file in /dockers" /root/.bashrc 2>/dev/null; then
|
|
|
|
cat >> /root/.bashrc <<EOF
|
|
|
|
# enable bash completion in interactive shells
|
|
|
|
if ! shopt -oq posix; then
|
|
|
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
|
|
. /usr/share/bash-completion/bash_completion
|
|
|
|
elif [ -f /etc/bash_completion ]; then
|
|
|
|
. /etc/bash_completion
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
for file in /kaz/bin/.*-completion.bash ; do
|
|
|
|
source "\${file}"
|
|
|
|
done
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# On met le KAZGUARD pour la mise au point
|
|
|
|
echo "export KAZGUARD='true'" >> /root/.bashrc
|
|
|
|
|
|
|
|
# On active fuse-overlayfs pour docker
|
|
|
|
cat >> /etc/docker/daemon.json <<EOF
|
|
|
|
{ "storage-driver": "fuse-overlayfs" }
|
|
|
|
EOF
|
|
|
|
service docker restart
|
|
|
|
mknod -m 666 /dev/fuse c 10 229 # + dans le rc.local ? + modprobe fuse sur l'ĥôte ?
|
|
|
|
|
|
|
|
./kaz.sh
|
|
|
|
|
|
|
|
# clear apt cache
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get clean
|