Pārlūkot izejas kodu

Syncthing devices on user control panel

Bob Mottram 9 gadus atpakaļ
vecāks
revīzija
ff2e640bde
1 mainītis faili ar 27 papildinājumiem un 11 dzēšanām
  1. 27
    11
      src/freedombone-controlpanel-user

+ 27
- 11
src/freedombone-controlpanel-user Parādīt failu

@@ -616,6 +616,20 @@ function menu_admin {
616 616
     fi
617 617
 }
618 618
 
619
+function syncthing_devices {
620
+    SYNCTHING_CONFIG_FILE=~/.syncthingids
621
+    SYNCTHING_ID=$(cat ~/.syncthing-server-id)
622
+    if [ ! -f $SYNCTHING_CONFIG_FILE ]; then
623
+        echo $'# Your syncthing configuration file' > $SYNCTHING_CONFIG_FILE
624
+        echo '#' >> $SYNCTHING_CONFIG_FILE
625
+        echo $"# The ${PROJECT_NAME} syncthing ID is: $SYNCTHING_ID"
626
+        echo '#' >> $SYNCTHING_CONFIG_FILE
627
+        echo '# Paste the IDs of your devices below' >> $SYNCTHING_CONFIG_FILE
628
+        echo '#' >> $SYNCTHING_CONFIG_FILE      
629
+    fi
630
+    editor $SYNCTHING_CONFIG_FILE
631
+}
632
+
619 633
 function menu_top_level {
620 634
     while true
621 635
     do
@@ -623,18 +637,19 @@ function menu_top_level {
623 637
         trap "rm -f $data" 0 1 2 5 15
624 638
         dialog --backtitle $"Freedombone User Control Panel" \
625 639
                --title $"User Control Panel" \
626
-               --radiolist $"Choose an operation:" 18 50 11 \
640
+               --radiolist $"Choose an operation:" 19 50 12 \
627 641
                1 $"Use Email" off \
628 642
                2 $"Change Email Filtering Rules" off \
629 643
                3 $"Use Tox Chat" off \
630 644
                4 $"Use XMPP Chat" off \
631 645
                5 $"Use IRC" off \
632 646
                6 $"Browse the Web" off \
633
-               7 $"Your Encryption Keys" off \
634
-               8 $"Set an outgoing email proxy" off \
635
-               9 $"Administrator controls" off \
636
-               10 $"Exit to the command line" off \
637
-               11 $"Log out" on 2> $data
647
+               7 $"Syncthing devices" off \
648
+               8 $"Your Encryption Keys" off \
649
+               9 $"Set an outgoing email proxy" off \
650
+               10 $"Administrator controls" off \
651
+               11 $"Exit to the command line" off \
652
+               12 $"Log out" on 2> $data
638 653
         sel=$?
639 654
         case $sel in
640 655
             1) exit 1;;
@@ -647,11 +662,12 @@ function menu_top_level {
647 662
             4) torify profanity;;
648 663
             5) torify irssi;;
649 664
             6) torify elinks;;
650
-            7) menu_encryption_keys;;
651
-            8) smtp_proxy;;
652
-            9) menu_admin;;
653
-            10) break;;
654
-            11) kill -HUP `pgrep -s 0 -o`;;
665
+            7) syncthing_devices;;
666
+            8) menu_encryption_keys;;
667
+            9) smtp_proxy;;
668
+            10) menu_admin;;
669
+            11) break;;
670
+            12) kill -HUP `pgrep -s 0 -o`;;
655 671
         esac
656 672
     done
657 673
 }