Bläddra i källkod

Shutdown and restart on control panel

Bob Mottram 9 år sedan
förälder
incheckning
89c1a4201b
2 ändrade filer med 34 tillägg och 4 borttagningar
  1. 33
    3
      src/freedombone-controlpanel
  2. 1
    1
      src/freedombone-image

+ 33
- 3
src/freedombone-controlpanel Visa fil

636
     any_key
636
     any_key
637
 }
637
 }
638
 
638
 
639
+function shut_down_system {
640
+    dialog --title "Power off the system" \
641
+           --backtitle "Freedombone Control Panel" \
642
+           --defaultno \
643
+           --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
644
+    sel=$?
645
+    case $sel in
646
+        1) return;;
647
+        255) return;;
648
+    esac
649
+    shutdown now
650
+}
651
+
652
+function restart_system {
653
+    dialog --title "Restart the system" \
654
+           --backtitle "Freedombone Control Panel" \
655
+           --defaultno \
656
+           --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
657
+    sel=$?
658
+    case $sel in
659
+        1) return;;
660
+        255) return;;
661
+    esac
662
+    reboot
663
+}
664
+
639
 function menu_backup_restore {
665
 function menu_backup_restore {
640
     while true
666
     while true
641
     do
667
     do
763
         trap "rm -f $data" 0 1 2 5 15
789
         trap "rm -f $data" 0 1 2 5 15
764
         dialog --backtitle "Freedombone Control Panel" \
790
         dialog --backtitle "Freedombone Control Panel" \
765
                --title "Control Panel" \
791
                --title "Control Panel" \
766
-               --radiolist "Choose an operation:" 16 70 9 \
792
+               --radiolist "Choose an operation:" 18 70 11 \
767
                1 "Backup and Restore" off \
793
                1 "Backup and Restore" off \
768
                2 "Show SIP Phone Extensions" off \
794
                2 "Show SIP Phone Extensions" off \
769
                3 "Reset Tripwire" off \
795
                3 "Reset Tripwire" off \
772
                6 "Email Filtering Rules" off \
798
                6 "Email Filtering Rules" off \
773
                7 "Security Settings" off \
799
                7 "Security Settings" off \
774
                8 "Hubzilla" off \
800
                8 "Hubzilla" off \
775
-               9 "Exit" on 2> $data
801
+               9 "Power off the system" off \
802
+               10 "Restart the system" off \
803
+               11 "Exit" on 2> $data
776
         sel=$?
804
         sel=$?
777
         case $sel in
805
         case $sel in
778
             1) exit 1;;
806
             1) exit 1;;
787
             6) menu_email;;
815
             6) menu_email;;
788
             7) security_settings;;
816
             7) security_settings;;
789
             8) menu_hubzilla;;
817
             8) menu_hubzilla;;
790
-            9) break;;
818
+            9) shut_down_system;;
819
+            10) restart_system;;
820
+            11) break;;
791
         esac
821
         esac
792
     done
822
     done
793
 }
823
 }

+ 1
- 1
src/freedombone-image Visa fil

205
 mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR}
205
 mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR}
206
 mv build/${PROJECT_NAME}*.img ${CURR_DIR}
206
 mv build/${PROJECT_NAME}*.img ${CURR_DIR}
207
 mv build/${PROJECT_NAME}*.sig ${CURR_DIR}
207
 mv build/${PROJECT_NAME}*.sig ${CURR_DIR}
208
-rm -rf ${BUILD_DIR}
208
+#rm -rf ${BUILD_DIR}
209
 
209
 
210
 clear
210
 clear
211
 echo "
211
 echo "