Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stop Stop NETWORK or all
Parameters:
-n NETWORK Start/Stop sections in background monitoring NETWORK, force VERBOSE=0
-S SECTION SECTION to start
use either -N NETWORK or -S SECTION
use either -n NETWORK or -S SECTION

-h show this help and exit
-V show version and exit
Expand Down Expand Up @@ -63,9 +63,19 @@ while getopts ":hv:dn:S:V" OPT; do
done
shift $((OPTIND - 1 )) # OPTIND is 1 based

[ -n "$NETWORK" -a -n "$SECTION_ID" ] && usage_err "use either option '-N' or '-S' not both"
[ -n "$NETWORK" -a -n "$SECTION_ID" ] && usage_err "use either option '-n' or '-S' not both"
[ $# -eq 0 ] && usage_err "missing command"
[ $# -gt 1 ] && usage_err "to much commands"
if [ $# -gt 1 ]; then
if [ -z "$NETWORK" -a -z "$SECTION_ID" ]; then
case "$1:$2" in
start:*|stop:*|reload:*) ;;
*:[0-9]*)
usage_err "legacy syntax detected ('$1 $2'); use '-S $1 -v $2 -- start'"
;;
esac
fi
usage_err "too many commands"
fi

case "$1" in
start)
Expand Down
Loading