Selaa lähdekoodia

Hubzilla menu

Bob Mottram 9 vuotta sitten
vanhempi
commit
7f2e900a42
1 muutettua tiedostoa jossa 40 lisäystä ja 2 poistoa
  1. 40
    2
      src/freedombone-controlpanel

+ 40
- 2
src/freedombone-controlpanel Näytä tiedosto

521
   any_key
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
 function hubzilla_channel_directory_server {
538
 function hubzilla_channel_directory_server {
525
     if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
539
     if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
526
        dialog --title "Hubzilla channel directory server" \
540
        dialog --title "Hubzilla channel directory server" \
690
     done
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
 function menu_top_level {
731
 function menu_top_level {
694
     while true
732
     while true
695
     do
733
     do
705
                5 "Manage Users" off \
743
                5 "Manage Users" off \
706
                6 "Email Filtering Rules" off \
744
                6 "Email Filtering Rules" off \
707
                7 "Security Settings" off \
745
                7 "Security Settings" off \
708
-               8 "Set Hubzilla channel directory server" off \
746
+               8 "Hubzilla" off \
709
                9 "Exit" on 2> $data
747
                9 "Exit" on 2> $data
710
         sel=$?
748
         sel=$?
711
         case $sel in
749
         case $sel in
720
             5) menu_users;;
758
             5) menu_users;;
721
             6) menu_email;;
759
             6) menu_email;;
722
             7) security_settings;;
760
             7) security_settings;;
723
-            8) hubzilla_channel_directory_server;;
761
+            8) menu_hubzilla;;
724
             9) break;;
762
             9) break;;
725
         esac
763
         esac
726
     done
764
     done