Skip to content

Commit

Permalink
added -F flag (Fallback) to script
Browse files Browse the repository at this point in the history
  • Loading branch information
Cielquan committed Dec 10, 2019
1 parent 7995cdb commit ef9677e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions start_doth_dns.bash
Expand Up @@ -59,7 +59,7 @@ exit_dc_err() {

# Func for showing usage string
usage_string() {
printf "\nUsage: %s [-f] [-a <arm|x86>] [-c] [-I <INTERFACE>] [-i <IP ADDRESS>] `
printf "\nUsage: %s [-f] [-F] [-a <arm|x86>] [-c] [-I <INTERFACE>] [-i <IP ADDRESS>] `
`[-n <HOSTNAME>] [-t <TIMEZONE>] [-d <DOMAIN>] [-N] [-R] [-U] [-P] [-D] [-h]\n" "$0" 1>&2;
}

Expand All @@ -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"
Expand Down

0 comments on commit ef9677e

Please sign in to comment.