From 919354059c3e70eef5ee92bc18a5c103ba882c80 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 21 May 2017 10:18:47 +0100 Subject: [PATCH] Argument parsing for synamic DNS where no provider given --- src/freedombone | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/freedombone b/src/freedombone index bedc5a85..cbb05c01 100755 --- a/src/freedombone +++ b/src/freedombone @@ -277,6 +277,9 @@ function parse_args { read_config_param 'MY_USERNAME' read_config_param 'SYSTEM_TYPE' read_config_param 'ONION_ONLY' + read_config_param 'DDNS_PROVIDER' + read_config_param 'DDNS_USERNAME' + read_config_param 'DDNS_PASSWORD' if [ ! -d /home/$MY_USERNAME ]; then 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 { exit 3 fi if [[ $SYSTEM_TYPE != "mesh"* ]]; then - if [[ $ONION_ONLY == "no" ]]; then - if [ ! $DDNS_USERNAME ]; then - echo $'Please provide the username for your dynamic DNS provider with the --ddnsuser option' - exit 7823 - fi - if [ ! $DDNS_PASSWORD ]; then - echo $'Please provide the password for your dynamic DNS provider with the --ddnspass option' - exit 6382 + if [[ $DDNS_PROVIDER != 'none' ]]; then + if [[ $ONION_ONLY == "no" ]]; then + if [ ! $DDNS_USERNAME ]; then + echo $'Please provide the username for your dynamic DNS provider with the --ddnsuser option' + exit 7823 + fi + if [ ! $DDNS_PASSWORD ]; then + echo $'Please provide the password for your dynamic DNS provider with the --ddnspass option' + exit 6382 + fi fi fi fi