Browse Source

Argument parsing for synamic DNS where no provider given

Bob Mottram 7 years ago
parent
commit
919354059c
1 changed files with 13 additions and 8 deletions
  1. 13
    8
      src/freedombone

+ 13
- 8
src/freedombone View File

@@ -277,6 +277,9 @@ function parse_args {
277 277
     read_config_param 'MY_USERNAME'
278 278
     read_config_param 'SYSTEM_TYPE'
279 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 284
     if [ ! -d /home/$MY_USERNAME ]; then
282 285
         echo $"There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
@@ -295,14 +298,16 @@ function parse_args {
295 298
         exit 3
296 299
     fi
297 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 311
             fi
307 312
         fi
308 313
     fi