Bladeren bron

Set main repo within control panel

Bob Mottram 9 jaren geleden
bovenliggende
commit
0181518f60
1 gewijzigde bestanden met toevoegingen van 38 en 23 verwijderingen
  1. 38
    23
      src/freedombone-controlpanel

+ 38
- 23
src/freedombone-controlpanel Bestand weergeven

82
     any_key
82
     any_key
83
 }
83
 }
84
 
84
 
85
-function set_project_repo {
85
+function set_main_repo {
86
     data=$(tempfile 2>/dev/null)
86
     data=$(tempfile 2>/dev/null)
87
-    # TODO
87
+    dialog --backtitle $"Freedombone Control Panel" \
88
+           --title $"Main Repository" \
89
+           --inputbox $"Set the main repository:" 8 40 "$PROJECT_REPO" 2>data
90
+    sel=$?
91
+    case $sel in
92
+        1) return;;
93
+        255) return;;
94
+    esac
95
+    repo=$(cat $data)
96
+    if [[ $repo == *"."* ]]; then
97
+        PROJECT_REPO=$(cat $data)
98
+        dialog --title $"Main Repository" \
99
+               --msgbox $"Main repository set to $PROJECT_REPO" 6 40
100
+    fi
88
 }
101
 }
89
 
102
 
90
 function add_user {
103
 function add_user {
1387
         trap "rm -f $data" 0 1 2 5 15
1400
         trap "rm -f $data" 0 1 2 5 15
1388
         dialog --backtitle $"Freedombone Control Panel" \
1401
         dialog --backtitle $"Freedombone Control Panel" \
1389
                --title $"Control Panel" \
1402
                --title $"Control Panel" \
1390
-               --radiolist $"Choose an operation:" 25 70 18 \
1403
+               --radiolist $"Choose an operation:" 26 70 19 \
1391
                1 $"About this system" off \
1404
                1 $"About this system" off \
1392
                2 $"Backup and Restore" off \
1405
                2 $"Backup and Restore" off \
1393
                3 $"Reset Tripwire" off \
1406
                3 $"Reset Tripwire" off \
1396
                6 $"Manage Users" off \
1409
                6 $"Manage Users" off \
1397
                7 $"Email Filtering Rules" off \
1410
                7 $"Email Filtering Rules" off \
1398
                8 $"Security Settings" off \
1411
                8 $"Security Settings" off \
1399
-               9 $"Hubzilla" off \
1400
-               10 $"Media menu" off \
1401
-               11 $"IRC menu" off \
1402
-               12 $"Change the name of this system" off \
1403
-               13 $"Set the TLS date/time source" off \
1404
-               14 $"Set a static local IP address" off \
1405
-               15 $"Check for updates" off \
1406
-               16 $"Power off the system" off \
1407
-               17 $"Restart the system" off \
1408
-               18 $"Exit" on 2> $data
1412
+               9 $"Set the main repository" off \
1413
+               10 $"Hubzilla" off \
1414
+               11 $"Media menu" off \
1415
+               12 $"IRC menu" off \
1416
+               13 $"Change the name of this system" off \
1417
+               14 $"Set the TLS date/time source" off \
1418
+               15 $"Set a static local IP address" off \
1419
+               16 $"Check for updates" off \
1420
+               17 $"Power off the system" off \
1421
+               18 $"Restart the system" off \
1422
+               19 $"Exit" on 2> $data
1409
         sel=$?
1423
         sel=$?
1410
         case $sel in
1424
         case $sel in
1411
             1) exit 1;;
1425
             1) exit 1;;
1420
             6) menu_users;;
1434
             6) menu_users;;
1421
             7) menu_email;;
1435
             7) menu_email;;
1422
             8) security_settings;;
1436
             8) security_settings;;
1423
-            9) menu_hubzilla;;
1424
-            10) menu_media;;
1425
-            11) menu_irc;;
1426
-            12) change_system_name;;
1427
-            13) set_tls_time_source;;
1428
-            14) set_static_IP;;
1429
-            15) check_for_updates;;
1430
-            16) shut_down_system;;
1431
-            17) restart_system;;
1432
-            18) break;;
1437
+            9) set_main_repo;;
1438
+            10) menu_hubzilla;;
1439
+            11) menu_media;;
1440
+            12) menu_irc;;
1441
+            13) change_system_name;;
1442
+            14) set_tls_time_source;;
1443
+            15) set_static_IP;;
1444
+            16) check_for_updates;;
1445
+            17) shut_down_system;;
1446
+            18) restart_system;;
1447
+            19) break;;
1433
         esac
1448
         esac
1434
     done
1449
     done
1435
 }
1450
 }