From: ajacoutot Date: Mon, 12 Jan 2015 13:51:20 +0000 (+0000) Subject: Make it possible to reset "timeout" to the default value. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3baa268fc45b50c4a0e2e1ed9f630745bfa072f7;p=openbsd Make it possible to reset "timeout" to the default value. --- diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index 534e2736d9c..93b20b9ddc1 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: rcctl.sh,v 1.61 2015/01/12 13:40:12 ajacoutot Exp $ +# $OpenBSD: rcctl.sh,v 1.62 2015/01/12 13:51:20 ajacoutot Exp $ # # Copyright (c) 2014, 2015 Antoine Jacoutot # Copyright (c) 2014 Ingo Schwarze @@ -303,13 +303,12 @@ svc_set() return fi - if [ "${_var}" = "timeout" ]; then - [[ ${_args} != +([[:digit:]]) || ${_args} -le 0 ]] && \ - _rc_err "${0##*/}: \"${_args}\" is not a positive integer" - fi - - # unset flags if they match the default enabled ones if [ -n "${_args}" ]; then + if [ "${_var}" = "timeout" ]; then + [[ ${_args} != +([[:digit:]]) || ${_args} -le 0 ]] && \ + _rc_err "${0##*/}: \"${_args}\" is not a positive integer" + fi + # unset flags if they match the default enabled ones [ "${_args}" = "$(svc_getdef ${_svc} ${_var})" ] && \ unset _args fi