From 2398313487b35fbfbcd388cadb9dfbc4a4dfc08d Mon Sep 17 00:00:00 2001 From: rasul Date: Wed, 3 Jun 2020 15:09:23 -0500 Subject: [PATCH] config file option --- he-ddns | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/he-ddns b/he-ddns index 0f17f94..094df3b 100755 --- a/he-ddns +++ b/he-ddns @@ -13,10 +13,11 @@ Update Hurricane Electric Dynamic DNS for DOMAIN with key in KEYFILE. Requires curl to be installed in \$PATH. Options: - -4, --ipv4 use IPv4 - -6, --ipv6 use IPv6 - -u, --url url to use, defaults to $url - -h, --help Display this help. + -c, --config FILE get configuration from FILE instead of $config + -4, --ipv4 use IPv4 + -6, --ipv6 use IPv6 + -u, --url URL update dns at URL instead of $url + -h, --help Display this help https://gitlab.com/rascul/he-ddns " @@ -28,9 +29,18 @@ show_help() { args= ipv4= ipv6= +config=/etc/he-ddnsrc while (($#)); do case $1 in + -c|--config) + if [[ -n "$2" ]]; then + config="$2" + shift + else + die $LINENO "$help_text" + fi + ;; -4) ipv4=true ;;