dotfiles/bash/.bash/03-boot.bash

33 lines
996 B
Bash
Raw Normal View History

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
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
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