2022-11-16 19:01:14 -07:00
|
|
|
#!/bin/bash
|
2022-03-22 00:04:49 -06:00
|
|
|
#
|
|
|
|
# 03-boot.bash
|
|
|
|
# startup scripts for systems
|
2022-10-26 12:05:56 -06:00
|
|
|
|
2022-03-22 00:04:49 -06:00
|
|
|
# run startup script if tty
|
|
|
|
# for dingo
|
2023-09-03 00:13:21 -06:00
|
|
|
if [[ $TERM == 'linux' && $(hostname) == 'landseer' ]]; then
|
2022-03-22 00:04:49 -06:00
|
|
|
cat ~/bin/house.txt
|
|
|
|
printf "\n${CYAN}Welcome back Bryson :)\n\n"
|
2023-09-03 00:13:21 -06:00
|
|
|
printf "${LGREEN}What should landseer do?\n${magenta}"
|
|
|
|
echo -e "\tn: start x\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n"
|
2022-03-22 00:04:49 -06:00
|
|
|
|
|
|
|
while read -rs -N 1 key; do
|
2022-05-02 23:02:43 -06:00
|
|
|
printf "${NC}"
|
2022-03-22 00:04:49 -06:00
|
|
|
case $key in
|
2023-09-03 00:13:21 -06:00
|
|
|
n) startx ;;
|
|
|
|
q) echo "Are you sure you want to shutdown? (y/n)";
|
|
|
|
read -rs -N 1 key2; case $key2 in y) doas shutdown -Ph now ;; esac; ;;
|
|
|
|
r) echo "Are you sure you want to reboot? (y/n)";
|
|
|
|
read -rs -N 1 key3; case $key3 in y) doas reboot ;; esac; ;;
|
|
|
|
l) logout ;;
|
|
|
|
b) break ;;
|
2022-03-22 00:04:49 -06:00
|
|
|
[h?]) echo "$USAGE";;
|
|
|
|
esac
|
2022-05-02 23:02:43 -06:00
|
|
|
clear
|
2022-10-26 12:05:56 -06:00
|
|
|
cat ~/bin/house.txt
|
2023-09-03 00:13:21 -06:00
|
|
|
printf "\n${LGREEN}What should landseer do?\n${magenta}"
|
|
|
|
echo -e "\tn: start x\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n"
|
2022-03-22 00:04:49 -06:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|