From ef9677ef8d089ca5b5ad6e221b8601cc1c5e0c4d Mon Sep 17 00:00:00 2001 From: Cielquan <43916661+Cielquan@users.noreply.github.com> Date: Tue, 10 Dec 2019 18:45:37 +0100 Subject: [PATCH] added `-F` flag (Fallback) to script --- start_doth_dns.bash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/start_doth_dns.bash b/start_doth_dns.bash index ba741fb..6bd8033 100755 --- a/start_doth_dns.bash +++ b/start_doth_dns.bash @@ -59,7 +59,7 @@ exit_dc_err() { # Func for showing usage string usage_string() { - printf "\nUsage: %s [-f] [-a ] [-c] [-I ] [-i ] ` + printf "\nUsage: %s [-f] [-F] [-a ] [-c] [-I ] [-i ] ` `[-n ] [-t ] [-d ] [-N] [-R] [-U] [-P] [-D] [-h]\n" "$0" 1>&2; } @@ -79,11 +79,14 @@ help() { # ########################################################################################## # Catching flags -while getopts ":fa:cI:i:n:t:d:NRUPDh" flag; do +while getopts ":fFa:cI:i:n:t:d:NRUPDh" flag; do case ${flag} in f) # Set for overwriting existing configs with new ones. _FLAG_FRESH='y' ;; + F) # Set to let the script fallback to next source for configuration variables. Order: `flag -> .env file -> environment -> self gather` + _FLAG_FALLBACK='y' + ;; a) # Set ARCHITECTURE variable with 'ARM' or 'x86' (case insensitive). if ! [[ "${OPTARG,,}" == 'arm' ]] && ! [[ "${OPTARG,,}" == 'x86' ]]; then printf "No valid argument for '-a'.\n"