2022-08-10 00:00:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
export PATH="/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
|
2022-09-26 13:58:26 +00:00
|
|
|
export HOME="/root"
|
2022-08-10 00:00:49 +00:00
|
|
|
CHOICE=1
|
|
|
|
while true; do
|
|
|
|
echo "Welcome to windvn!"
|
|
|
|
echo "1: Finish installation"
|
|
|
|
echo "2: Open bash"
|
|
|
|
echo "3: Shut down"
|
|
|
|
read -p "Choice: " CHOICE
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
if [ "$CHOICE" == "1" ]; then
|
2022-08-15 06:31:02 +00:00
|
|
|
apt -y install locales tzdata
|
2022-08-10 00:00:49 +00:00
|
|
|
dpkg-reconfigure locales
|
|
|
|
dpkg-reconfigure tzdata
|
|
|
|
groupadd -f sudo
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
read -p "First user (Administrator): " NEW_USER
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
adduser --gecos "" "$NEW_USER"
|
2022-09-21 10:46:14 +00:00
|
|
|
adduser "$NEW_USER" "sudo"
|
2022-08-10 00:00:49 +00:00
|
|
|
)
|
|
|
|
if [ "$?" == "0" ]; then
|
|
|
|
break
|
|
|
|
else
|
|
|
|
deluser --remove-home "$NEW_USER"
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2023-01-28 00:48:07 +00:00
|
|
|
set -e
|
2022-08-10 00:00:49 +00:00
|
|
|
for file in "/oobe/setupComplete"/*; do
|
|
|
|
if [[ -x "$file" ]]; then
|
|
|
|
source "$file"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "$HOSTNAME" > /etc/hostname
|
|
|
|
|
|
|
|
echo "127.0.0.1 localhost
|
2022-05-10 10:50:10 +00:00
|
|
|
127.0.1.1 $HOSTNAME
|
|
|
|
|
|
|
|
# The following lines are desirable for IPv6 capable hosts
|
|
|
|
::1 localhost ip6-localhost ip6-loopback
|
|
|
|
ff02::1 ip6-allnodes
|
2022-08-10 00:00:49 +00:00
|
|
|
ff02::2 ip6-allrouters
|
|
|
|
" > /etc/hosts
|
2022-05-10 10:50:10 +00:00
|
|
|
|
2022-08-10 00:00:49 +00:00
|
|
|
rm "/bin/login"
|
|
|
|
mv "/bin/login.bak" "/bin/login"
|
2022-10-19 09:36:33 +00:00
|
|
|
|
2022-11-07 00:53:04 +00:00
|
|
|
echo "Setup complete. Press ENTER to use windvn."
|
2022-10-19 09:36:33 +00:00
|
|
|
read -p ""
|
2022-11-07 00:53:04 +00:00
|
|
|
exit
|
2022-08-10 00:00:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CHOICE" == "2" ]; then
|
|
|
|
bash
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CHOICE" == "3" ]; then
|
|
|
|
poweroff
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
done
|