Bob Mottram 9 anni fa
parent
commit
7f2e900a42
1 ha cambiato i file con 40 aggiunte e 2 eliminazioni
  1. 40
    2
      src/freedombone-controlpanel

+ 40
- 2
src/freedombone-controlpanel Vedi File

@@ -521,6 +521,20 @@ function reset_tripwire {
521 521
   any_key
522 522
 }
523 523
 
524
+function hubzilla_restore {
525
+    dialog --title "Restore hubzilla from USB backup" \
526
+           --backtitle "Freedombone Control Panel" \
527
+           --yesno "\nInsert your USB backup drive and select 'yes' to continue" 16 60
528
+    sel=$?
529
+    case $sel in
530
+        1) return;;
531
+        255) return;;
532
+    esac
533
+    clear
534
+    echo 'Enter your backup drive password:'
535
+    restorehubzilla
536
+}
537
+
524 538
 function hubzilla_channel_directory_server {
525 539
     if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
526 540
        dialog --title "Hubzilla channel directory server" \
@@ -690,6 +704,30 @@ function menu_users {
690 704
     done
691 705
 }
692 706
 
707
+function menu_hubzilla {
708
+    while true
709
+    do
710
+        data=$(tempfile 2>/dev/null)
711
+        trap "rm -f $data" 0 1 2 5 15
712
+        dialog --backtitle "Freedombone Control Panel" \
713
+               --title "Hubzilla" \
714
+               --radiolist "Choose an operation:" 12 70 3 \
715
+               1 "Restore from usb backup" off \
716
+               2 "Set channel directory server" off \
717
+               3 "Back to main menu" on 2> $data
718
+        sel=$?
719
+        case $sel in
720
+            1) break;;
721
+            255) break;;
722
+        esac
723
+        case $(cat $data) in
724
+            1) hubzilla_restore;;
725
+            2) hubzilla_channel_directory_server;;
726
+            3) break;;
727
+        esac
728
+    done
729
+}
730
+
693 731
 function menu_top_level {
694 732
     while true
695 733
     do
@@ -705,7 +743,7 @@ function menu_top_level {
705 743
                5 "Manage Users" off \
706 744
                6 "Email Filtering Rules" off \
707 745
                7 "Security Settings" off \
708
-               8 "Set Hubzilla channel directory server" off \
746
+               8 "Hubzilla" off \
709 747
                9 "Exit" on 2> $data
710 748
         sel=$?
711 749
         case $sel in
@@ -720,7 +758,7 @@ function menu_top_level {
720 758
             5) menu_users;;
721 759
             6) menu_email;;
722 760
             7) security_settings;;
723
-            8) hubzilla_channel_directory_server;;
761
+            8) menu_hubzilla;;
724 762
             9) break;;
725 763
         esac
726 764
     done