raspiblitz/home.admin/setup.scripts/dialogBasicSetup.sh

41 lines
1.3 KiB
Bash
Raw Normal View History

2021-05-03 14:00:01 +02:00
#!/bin/bash
# get basic system information
# these are the same set of infos the WebGUI dialog/controler has
2021-05-21 20:23:26 -05:00
source /home/admin/_version.info
2021-05-03 14:00:01 +02:00
2021-05-21 20:23:26 -05:00
# chose how to setup node (fresh or from a upload backup)
2021-05-03 14:00:01 +02:00
OPTIONS=()
2021-05-21 20:23:26 -05:00
OPTIONS+=(FRESHSETUP "Setup a new RaspiBlitz")
OPTIONS+=(FROMBACKUP "Upload Migration Backup")
OPTIONS+=(SHUTDOWN "Shutdown without Changes")
2021-05-03 14:00:01 +02:00
CHOICE=$(dialog --clear \
--backtitle "RaspiBlitz ${codeVersion} - Setup" \
--title "⚡ Welcome to your RaspiBlitz ⚡" \
--menu "\nChoose how you want to setup your RaspiBlitz: \n " \
2021-05-21 20:46:18 -05:00
12 64 6 \
2021-05-03 14:00:01 +02:00
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
2021-05-21 20:23:26 -05:00
FRESHSETUP)
# 0 --> FRESH SETUP
exit 0;
2021-05-03 14:00:01 +02:00
;;
2021-05-21 20:23:26 -05:00
FROMBACKUP)
# 1 --> UPLOAD MIGRATION BACKUP
exit 1
2021-05-03 14:00:01 +02:00
;;
2021-05-21 20:23:26 -05:00
SHUTDOWN)
# 2 --> SHUTDOWN
2021-05-21 20:46:18 -05:00
clear
echo "Shutting down without changes ..."
2021-05-23 10:08:58 -05:00
echo "Cut power when you see no status LED blinking anymore."
2021-05-21 20:23:26 -05:00
exit 2
2021-05-03 14:00:01 +02:00
;;
2021-05-21 20:23:26 -05:00
*)
# 3 --> ESC/CANCEL = EXIT TO TERMINAL
clear
echo "Exit to Terminal from RaspiBlitz Setup ..."
exit 3
esac