windvn/mods/live-installer/data/bin/login

67 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
export PATH="/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
export HOME="/root"
function wdvn-chroot {
(
set -e
mount -o bind "/dev" "$1/dev"
mount -o bind "/dev/pts" "$1/dev/pts"
mount -o bind "/sys" "$1/sys"
mount -t proc none "$1/proc"
chroot "$1" ${@:2}
)
if [ $? != 0 ]; then
wdvn-chroot-end "$1"
exit 1
fi
wdvn-chroot-end "$1"
}
function wdvn-chroot-end {
umount -l "$1/proc"
umount -l "$1/sys"
umount -l "$1/dev/pts"
umount -l "$1/dev"
}
CHOICE=1
dpkg-reconfigure keyboard-configuration
service console-setup.sh restart
udevadm trigger --subsystem-match=input --action=change
service keyboard-setup.sh restart
clear
while true; do
echo ""
echo "Welcome to windvn!"
echo "1: Install"
echo "2: Open bash"
echo "3: Reboot"
echo "4: Shut down"
read -p "Choice: " CHOICE
echo ""
if [ "$CHOICE" == "1" ]; then
/opt/wdvn/installer/main
fi
if [ "$CHOICE" == "2" ]; then
bash
fi
if [ "$CHOICE" == "3" ]; then
reboot
exit
fi
if [ "$CHOICE" == "4" ]; then
poweroff
exit
fi
echo ""
done