refactor: ip4 and ip6 mutual override

- use the most recently specified option
This commit is contained in:
Asif Bacchus 2021-05-07 14:03:52 -06:00
parent 1ede37961f
commit cf820d777d

View File

@ -133,6 +133,7 @@ while [ $# -gt 0 ]; do
-4 | --ip4 | --ipv4) -4 | --ip4 | --ipv4)
# operate in IP4 mode (default) # operate in IP4 mode (default)
ip4=1 ip4=1
ip6=0
;; ;;
-6 | --ip6 | --ipv6) -6 | --ip6 | --ipv6)
# operate in IP6 mode # operate in IP6 mode
@ -154,7 +155,6 @@ if ! command -v curl >/dev/null; then
exit 2 exit 2
fi fi
[ -z "$dnsRecords" ] && badParam errMsg "You must specify at least one DNS record to update. Exiting." [ -z "$dnsRecords" ] && badParam errMsg "You must specify at least one DNS record to update. Exiting."
[ "$ip4" -eq 1 ] && [ "$ip6" -eq 1 ] && badParam errMsg "Cannot operate in IP4 and IP6 modes simultaneously. Exiting."
# turn off log file colourization if parameter is set # turn off log file colourization if parameter is set
if [ "$colourizeLogFile" -eq 0 ]; then if [ "$colourizeLogFile" -eq 0 ]; then
bold="" bold=""