2022-11-21 22:18:12 +00:00
|
|
|
#!/bin/sh
|
2022-11-21 22:23:43 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-08-03 10:27:15 +00:00
|
|
|
# install additional packages
|
|
|
|
apk add nano busybox-extras
|
|
|
|
|
2021-05-25 12:47:24 +00:00
|
|
|
# reset terminal modes
|
|
|
|
sed -i "$(printf '1i\e[?5l\e[?7h\e[?8h')" /etc/motd
|
|
|
|
|
2020-08-07 08:52:36 +00:00
|
|
|
# create .profile
|
|
|
|
cat > /root/.profile << 'EOF'
|
|
|
|
# ~/.profile: executed by Bourne-compatible login shells.
|
|
|
|
|
|
|
|
if [ "$BASH" ]; then
|
|
|
|
if [ -f ~/.bashrc ]; then
|
|
|
|
. ~/.bashrc
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
mesg n || true
|
|
|
|
EOF
|
|
|
|
|
|
|
|
find /home -type d -mindepth 1 -maxdepth 1 | while read -r home; do
|
|
|
|
cp -p /root/.profile "$home/"
|
|
|
|
chown $(stat -c '%u:%g' "$home") "$home/.profile"
|
|
|
|
done
|
|
|
|
|
2020-08-03 10:27:15 +00:00
|
|
|
# network configuration
|
|
|
|
cat > /etc/network/interfaces << EOF
|
2015-09-28 10:14:31 +00:00
|
|
|
#
|
2020-08-03 10:27:15 +00:00
|
|
|
# This is a sample network config, uncomment lines to configure the network
|
2015-09-28 10:14:31 +00:00
|
|
|
#
|
|
|
|
|
2020-08-03 10:27:15 +00:00
|
|
|
# Loopback interface
|
2015-09-28 10:14:31 +00:00
|
|
|
auto lo
|
|
|
|
iface lo inet loopback
|
|
|
|
|
2020-08-03 10:27:15 +00:00
|
|
|
# Static config for eth0
|
|
|
|
#auto eth0
|
|
|
|
#iface eth0 inet static
|
|
|
|
# address 192.168.0.2
|
|
|
|
# netmask 255.255.255.0
|
|
|
|
# gateway 192.168.0.1
|
|
|
|
# up echo nameserver 192.168.0.1 > /etc/resolv.conf
|
2015-09-28 10:14:31 +00:00
|
|
|
|
2020-08-03 10:27:15 +00:00
|
|
|
# DHCP config for eth0
|
2020-08-06 09:57:05 +00:00
|
|
|
#auto eth0
|
|
|
|
#iface eth0 inet dhcp
|
2020-08-03 10:27:15 +00:00
|
|
|
# hostname $(hostname)
|
2015-09-28 10:14:31 +00:00
|
|
|
EOF
|
|
|
|
|
2020-08-03 10:27:15 +00:00
|
|
|
cat > /etc/resolv.conf << EOF
|
|
|
|
EOF
|