modified bootstrap.sh
This commit is contained in:
+29
-4
@@ -19,6 +19,13 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MYUSER=$(whoami)
|
||||
if [ "${MYUSER}" != "root" ]; then
|
||||
echo "*** USER NOT ROOT ***"
|
||||
echo "*** ABORTING ********"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** START ***"
|
||||
|
||||
echo "## cleaning sources.list"
|
||||
@@ -66,6 +73,19 @@ LC_MEASUREMENT=de_DE.UTF-8
|
||||
LC_IDENTIFICATION=de_DE.UTF-8
|
||||
EOF
|
||||
|
||||
echo "## setting options"
|
||||
sed -i 's/^#precedence ::ffff:0:0\/96 100/precedence ::ffff:0:0\/96 100/g' /etc/gai.conf
|
||||
|
||||
echo "## services mgmt"
|
||||
MPT=$(dpkg -l | grep -c multipath-tools)
|
||||
if [ "${MPT}" -gt 0 ]; then
|
||||
for service in multipathd.service multipathd.socket multipath-tools-boot.service multipath-tools.service
|
||||
do
|
||||
systemctl stop "$service" 2>/dev/null || true
|
||||
systemctl disable "$service" 2>/dev/null || true
|
||||
done
|
||||
fi
|
||||
|
||||
echo "## installing tools"
|
||||
dpkg --configure -a
|
||||
apt-get -q -y install \
|
||||
@@ -92,9 +112,11 @@ echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true |
|
||||
dpkg-reconfigure -f noninteractive unattended-upgrades
|
||||
|
||||
echo "## setting vim config"
|
||||
truncate -s0 /root/.vimrc
|
||||
echo "set mouse=" >>/root/.vimrc
|
||||
echo "syntax on" >>/root/.vimrc
|
||||
if [ ! -f "/root/.vimrc" ]; then
|
||||
truncate -s0 /root/.vimrc
|
||||
echo "set mouse=" >>/root/.vimrc
|
||||
echo "syntax on" >>/root/.vimrc
|
||||
fi
|
||||
|
||||
echo "## setting ssh keys"
|
||||
mkdir -p /root/.ssh/
|
||||
@@ -105,7 +127,10 @@ echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICFP1rThjJUx618ao9fmvLCTAvMdIyPLz5DTFZ
|
||||
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEXgwNeuzCW6NG5gLDcq/YIsy3LifxtuesAUkYHNNKV root@backup" >>/root/.ssh/authorized_keys
|
||||
|
||||
chmod 600 /root/.ssh/authorized_keys
|
||||
chown -R root:root /root/.ssh /root/.vimrc
|
||||
chown -R root:root /root/.ssh
|
||||
if [ -f "/root/.vimrc" ]; then
|
||||
chown root:root /root/.vimrc
|
||||
fi
|
||||
|
||||
echo "## syncing time"
|
||||
ntpdate pool.ntp.org || true
|
||||
|
||||
Reference in New Issue
Block a user