Skip to content
Snippets Groups Projects
Commit 89c1a420 authored by Bob Mottram's avatar Bob Mottram
Browse files

Shutdown and restart on control panel

parent 63e4c2a0
No related branches found
No related tags found
No related merge requests found
......@@ -636,6 +636,32 @@ function format_drive {
any_key
}
function shut_down_system {
dialog --title "Power off the system" \
--backtitle "Freedombone Control Panel" \
--defaultno \
--yesno "\nPlease confirm that you wish to power off the system.\n\nWARNING: to power on again you will need to have physical access to the hardware." 10 60
sel=$?
case $sel in
1) return;;
255) return;;
esac
shutdown now
}
function restart_system {
dialog --title "Restart the system" \
--backtitle "Freedombone Control Panel" \
--defaultno \
--yesno "\nPlease confirm that you wish to restart the system.\n\nWARNING: If you are using full disk encryption then you will need physical access to the hardware to type in the password" 10 60
sel=$?
case $sel in
1) return;;
255) return;;
esac
reboot
}
function menu_backup_restore {
while true
do
......@@ -763,7 +789,7 @@ function menu_top_level {
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Control Panel" \
--title "Control Panel" \
--radiolist "Choose an operation:" 16 70 9 \
--radiolist "Choose an operation:" 18 70 11 \
1 "Backup and Restore" off \
2 "Show SIP Phone Extensions" off \
3 "Reset Tripwire" off \
......@@ -772,7 +798,9 @@ function menu_top_level {
6 "Email Filtering Rules" off \
7 "Security Settings" off \
8 "Hubzilla" off \
9 "Exit" on 2> $data
9 "Power off the system" off \
10 "Restart the system" off \
11 "Exit" on 2> $data
sel=$?
case $sel in
1) exit 1;;
......@@ -787,7 +815,9 @@ function menu_top_level {
6) menu_email;;
7) security_settings;;
8) menu_hubzilla;;
9) break;;
9) shut_down_system;;
10) restart_system;;
11) break;;
esac
done
}
......
......@@ -205,7 +205,7 @@ fi
mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR}
mv build/${PROJECT_NAME}*.img ${CURR_DIR}
mv build/${PROJECT_NAME}*.sig ${CURR_DIR}
rm -rf ${BUILD_DIR}
#rm -rf ${BUILD_DIR}
clear
echo "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment