Skip to content

Commit

Permalink
Fix argument check
Browse files Browse the repository at this point in the history
  • Loading branch information
evertramos committed Apr 1, 2021
1 parent 6577df9 commit 9e64bef
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions bin/fresh-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,63 +163,63 @@ while [[ $# -gt 0 ]]; do
# Network options
-ip)
ARG_IP_ADDRESS="${2}"
if [[ ARG_IP_ADDRESS == "" ]]; then
if [[ $ARG_IP_ADDRESS == "" ]]; then
echoerr "Invalid option for -ip"
break
fi
shift 2
;;
--ip-address=*)
ARG_IP_ADDRESS="${1#*=}"
if [[ ARG_IP_ADDRESS == "" ]]; then
if [[ $ARG_IP_ADDRESS == "" ]]; then
echoerr "Invalid option for --ip-address"
break
fi
shift 1
;;
-ipv6)
ARG_IPv6_ADDRESS="${2}"
if [[ ARG_IPv6_ADDRESS == "" ]]; then
if [[ $ARG_IPv6_ADDRESS == "" ]]; then
echoerr "Invalid option for -ipv6"
break
fi
shift 2
;;
--ipv6-address=*)
ARG_IPv6_ADDRESS="${1#*=}"
if [[ ARG_IPv6_ADDRESS == "" ]]; then
if [[ $ARG_IPv6_ADDRESS == "" ]]; then
echoerr "Invalid option for --ipv6-address"
break
fi
shift 1
;;
-net)
ARG_NETWORK_NAME="${2}"
if [[ ARG_NETWORK_NAME == "" ]]; then
if [[ $ARG_NETWORK_NAME == "" ]]; then
echoerr "Invalid option for -net"
break
fi
shift 2
;;
--network-name=*)
ARG_NETWORK_NAME="${1#*=}"
if [[ ARG_NETWORK_NAME == "" ]]; then
if [[ $ARG_NETWORK_NAME == "" ]]; then
echoerr "Invalid option for --network-name"
break
fi
shift 1
;;
-netopt)
NETWORK_OPTION="${2}"
if [[ NETWORK_OPTION == "" ]]; then
if [[ $NETWORK_OPTION == "" ]]; then
echoerr "Invalid option for -netopt"
break
fi
shift 2
;;
--network-option=*)
NETWORK_OPTION="${1#*=}"
if [[ NETWORK_OPTION == "" ]]; then
if [[ $NETWORK_OPTION == "" ]]; then
echoerr "Invalid option for --network-option"
break
fi
Expand All @@ -229,143 +229,143 @@ while [[ $# -gt 0 ]]; do
# Log settings
-lpd)
ARG_NGINX_PROXY_LOG_DRIVER="${2}"
if [[ ARG_NGINX_PROXY_LOG_DRIVER == "" ]]; then
if [[ $ARG_NGINX_PROXY_LOG_DRIVER == "" ]]; then
echoerr "Invalid option for -lpd"
break
fi
shift 2
;;
--log-nginx-proxy-driver=*)
ARG_NGINX_PROXY_LOG_DRIVER="${1#*=}"
if [[ ARG_NGINX_PROXY_LOG_DRIVER == "" ]]; then
if [[ $ARG_NGINX_PROXY_LOG_DRIVER == "" ]]; then
echoerr "Invalid option for --log-nginx-proxy-driver"
break
fi
shift 1
;;
-lpms)
ARG_NGINX_PROXY_LOG_MAX_SIZE="${2}"
if [[ ARG_NGINX_PROXY_LOG_MAX_SIZE == "" ]]; then
if [[ $ARG_NGINX_PROXY_LOG_MAX_SIZE == "" ]]; then
echoerr "Invalid option for -lpms"
break
fi
shift 2
;;
--log-nginx-proxy-max_size=*)
ARG_NGINX_PROXY_LOG_MAX_SIZE="${1#*=}"
if [[ ARG_NGINX_PROXY_LOG_MAX_SIZE == "" ]]; then
if [[ $ARG_NGINX_PROXY_LOG_MAX_SIZE == "" ]]; then
echoerr "Invalid option for --log-nginx-proxy-max_size"
break
fi
shift 1
;;
-lpmf)
ARG_NGINX_PROXY_LOG_MAX_FILE="${2}"
if [[ ARG_NGINX_PROXY_LOG_MAX_FILE == "" ]]; then
if [[ $ARG_NGINX_PROXY_LOG_MAX_FILE == "" ]]; then
echoerr "Invalid option for -lpmf"
break
fi
shift 2
;;
--log-nginx-proxy-max_file=*)
ARG_NGINX_PROXY_LOG_MAX_FILE="${1#*=}"
if [[ ARG_NGINX_PROXY_LOG_MAX_FILE == "" ]]; then
if [[ $ARG_NGINX_PROXY_LOG_MAX_FILE == "" ]]; then
echoerr "Invalid option for --log-nginx-proxy-max_file"
break
fi
shift 1
;;
-lgd)
ARG_DOCKER_GEN_LOG_DRIVER="${2}"
if [[ ARG_DOCKER_GEN_LOG_DRIVER == "" ]]; then
if [[ $ARG_DOCKER_GEN_LOG_DRIVER == "" ]]; then
echoerr "Invalid option for -lgd"
break
fi
shift 2
;;
--log-docker-gen-driver=*)
ARG_DOCKER_GEN_LOG_DRIVER="${1#*=}"
if [[ ARG_DOCKER_GEN_LOG_DRIVER == "" ]]; then
if [[ $ARG_DOCKER_GEN_LOG_DRIVER == "" ]]; then
echoerr "Invalid option for --log-docker-gen-driver"
break
fi
shift 1
;;
-lgms)
ARG_DOCKER_GEN_LOG_MAX_SIZE="${2}"
if [[ ARG_DOCKER_GEN_LOG_MAX_SIZE == "" ]]; then
if [[ $ARG_DOCKER_GEN_LOG_MAX_SIZE == "" ]]; then
echoerr "Invalid option for -lgms"
break
fi
shift 2
;;
--log-docker-gen-max_size=*)
ARG_DOCKER_GEN_LOG_MAX_SIZE="${1#*=}"
if [[ ARG_DOCKER_GEN_LOG_MAX_SIZE == "" ]]; then
if [[ $ARG_DOCKER_GEN_LOG_MAX_SIZE == "" ]]; then
echoerr "Invalid option for --log-docker-gen-max_size"
break
fi
shift 1
;;
-lgmf)
ARG_DOCKER_GEN_LOG_MAX_FILE="${2}"
if [[ ARG_DOCKER_GEN_LOG_MAX_FILE == "" ]]; then
if [[ $ARG_DOCKER_GEN_LOG_MAX_FILE == "" ]]; then
echoerr "Invalid option for -lgmf"
break
fi
shift 2
;;
--log-docker-gen-max_file=*)
ARG_DOCKER_GEN_LOG_MAX_FILE="${1#*=}"
if [[ ARG_DOCKER_GEN_LOG_MAX_FILE == "" ]]; then
if [[ $ARG_DOCKER_GEN_LOG_MAX_FILE == "" ]]; then
echoerr "Invalid option for --log-docker-gen-max_file"
break
fi
shift 1
;;
-lld)
ARG_LETSENCRYPT_LOG_DRIVER="${2}"
if [[ ARG_LETSENCRYPT_LOG_DRIVER == "" ]]; then
if [[ $ARG_LETSENCRYPT_LOG_DRIVER == "" ]]; then
echoerr "Invalid option for -lld"
break
fi
shift 2
;;
--log-letsencrypt-driver=*)
ARG_LETSENCRYPT_LOG_DRIVER="${1#*=}"
if [[ ARG_LETSENCRYPT_LOG_DRIVER == "" ]]; then
if [[ $ARG_LETSENCRYPT_LOG_DRIVER == "" ]]; then
echoerr "Invalid option for --log-letsencrypt-driver"
break
fi
shift 1
;;
-llms)
ARG_LETSENCRYPT_LOG_MAX_SIZE="${2}"
if [[ ARG_LETSENCRYPT_LOG_MAX_SIZE == "" ]]; then
if [[ $ARG_LETSENCRYPT_LOG_MAX_SIZE == "" ]]; then
echoerr "Invalid option for -llms"
break
fi
shift 2
;;
--log-letsencrypt-max_size=*)
ARG_LETSENCRYPT_LOG_MAX_SIZE="${1#*=}"
if [[ ARG_LETSENCRYPT_LOG_MAX_SIZE == "" ]]; then
if [[ $ARG_LETSENCRYPT_LOG_MAX_SIZE == "" ]]; then
echoerr "Invalid option for --log-letsencrypt-max_size"
break
fi
shift 1
;;
-llmf)
ARG_LETSENCRYPT_LOG_MAX_FILE="${2}"
if [[ ARG_LETSENCRYPT_LOG_MAX_FILE == "" ]]; then
if [[ $ARG_LETSENCRYPT_LOG_MAX_FILE == "" ]]; then
echoerr "Invalid option for -llmf"
break
fi
shift 2
;;
--log-letsencrypt-max_file=*)
ARG_LETSENCRYPT_LOG_MAX_FILE="${1#*=}"
if [[ ARG_LETSENCRYPT_LOG_MAX_FILE == "" ]]; then
if [[ $ARG_LETSENCRYPT_LOG_MAX_FILE == "" ]]; then
echoerr "Invalid option for --log-letsencrypt-max_file"
break
fi
Expand All @@ -375,31 +375,31 @@ while [[ $# -gt 0 ]]; do
# Port binginds
-phttp)
ARG_DOCKER_HTTP="${2}"
if [[ ARG_DOCKER_HTTP == "" ]]; then
if [[ $ARG_DOCKER_HTTP == "" ]]; then
echoerr "Invalid option for -phttp"
break
fi
shift 2
;;
--port-http=*)
ARG_DOCKER_HTTP="${1#*=}"
if [[ ARG_DOCKER_HTTP == "" ]]; then
if [[ $ARG_DOCKER_HTTP == "" ]]; then
echoerr "Invalid option for --port-http"
break
fi
shift 1
;;
-phttps)
ARG_DOCKER_HTTPS="${2}"
if [[ ARG_DOCKER_HTTPS == "" ]]; then
if [[ $ARG_DOCKER_HTTPS == "" ]]; then
echoerr "Invalid option for -phttps"
break
fi
shift 2
;;
--port-https=*)
ARG_DOCKER_HTTPS="${1#*=}"
if [[ ARG_DOCKER_HTTPS == "" ]]; then
if [[ $ARG_DOCKER_HTTPS == "" ]]; then
echoerr "Invalid option for --port-https"
break
fi
Expand All @@ -409,15 +409,15 @@ while [[ $# -gt 0 ]]; do
# SSL Policy
-sp)
ARG_SSL_POLICY="${2}"
if [[ ARG_SSL_POLICY == "" ]]; then
if [[ $ARG_SSL_POLICY == "" ]]; then
echoerr "Invalid option for -sp"
break
fi
shift 2
;;
--ssl-policy=*)
ARG_SSL_POLICY="${1#*=}"
if [[ ARG_SSL_POLICY == "" ]]; then
if [[ $ARG_SSL_POLICY == "" ]]; then
echoerr "Invalid option for --ssl-policy"
break
fi
Expand All @@ -427,7 +427,7 @@ while [[ $# -gt 0 ]]; do
# IPv6 options
--ipv6-subnet=*)
ARG_IPv6_SUBNET="${1#*=}"
if [[ ARG_IPv6_SUBNET == "" ]]; then
if [[ $ARG_IPv6_SUBNET == "" ]]; then
echoerr "Invalid option for --ipv6-subnet"
break
fi
Expand Down

0 comments on commit 9e64bef

Please sign in to comment.