Pārlūkot izejas kodu

Argument parsing for synamic DNS where no provider given

Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
919354059c
1 mainītis faili ar 13 papildinājumiem un 8 dzēšanām
  1. 13
    8
      src/freedombone

+ 13
- 8
src/freedombone Parādīt failu

277
     read_config_param 'MY_USERNAME'
277
     read_config_param 'MY_USERNAME'
278
     read_config_param 'SYSTEM_TYPE'
278
     read_config_param 'SYSTEM_TYPE'
279
     read_config_param 'ONION_ONLY'
279
     read_config_param 'ONION_ONLY'
280
+    read_config_param 'DDNS_PROVIDER'
281
+    read_config_param 'DDNS_USERNAME'
282
+    read_config_param 'DDNS_PASSWORD'
280
 
283
 
281
     if [ ! -d /home/$MY_USERNAME ]; then
284
     if [ ! -d /home/$MY_USERNAME ]; then
282
         echo $"There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
285
         echo $"There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
295
         exit 3
298
         exit 3
296
     fi
299
     fi
297
     if [[ $SYSTEM_TYPE != "mesh"* ]]; then
300
     if [[ $SYSTEM_TYPE != "mesh"* ]]; then
298
-        if [[ $ONION_ONLY == "no" ]]; then
299
-            if [ ! $DDNS_USERNAME ]; then
300
-                echo $'Please provide the username for your dynamic DNS provider with the --ddnsuser option'
301
-                exit 7823
302
-            fi
303
-            if [ ! $DDNS_PASSWORD ]; then
304
-                echo $'Please provide the password for your dynamic DNS provider with the --ddnspass option'
305
-                exit 6382
301
+        if [[ $DDNS_PROVIDER != 'none' ]]; then
302
+            if [[ $ONION_ONLY == "no" ]]; then
303
+                if [ ! $DDNS_USERNAME ]; then
304
+                    echo $'Please provide the username for your dynamic DNS provider with the --ddnsuser option'
305
+                    exit 7823
306
+                fi
307
+                if [ ! $DDNS_PASSWORD ]; then
308
+                    echo $'Please provide the password for your dynamic DNS provider with the --ddnspass option'
309
+                    exit 6382
310
+                fi
306
             fi
311
             fi
307
         fi
312
         fi
308
     fi
313
     fi