From: ajacoutot Date: Tue, 6 Jan 2015 14:48:59 +0000 (+0000) Subject: Simplify special vars argument checking; invalidating some bogus constructs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=312bbabaac7dc92251a2100c559c28f63563e7d9;p=openbsd Simplify special vars argument checking; invalidating some bogus constructs in the process. --- diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index 62f941b1caa..9b83a5924c3 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: rcctl.sh,v 1.58 2015/01/06 12:49:55 ajacoutot Exp $ +# $OpenBSD: rcctl.sh,v 1.59 2015/01/06 14:48:59 ajacoutot Exp $ # # Copyright (c) 2014, 2015 Antoine Jacoutot # Copyright (c) 2014 Ingo Schwarze @@ -365,9 +365,8 @@ if [ -n "${var}" ]; then [[ ${action} == @(enable|set) && ${var} = flags && ${args} = NO ]] && \ _rc_err "${0##*/}: \"flags NO\" contradicts \"${action}\"" if svc_is_special ${svc}; then - if [[ ${var} != @(flags|status) || \ - ${action} != @(set|get|getdef|enable) ]] || \ - [[ ${action} == @(enable|set) && -n ${args} ]]; then + if [[ ${action} == @(enable|set) && ${var} != status ]] || \ + [[ ${action} == @(get|getdef) && ${var} == @(timeout|user) ]] ; then _rc_err "${0##*/}: \"${svc}\" is a special variable, cannot \"${action} ${svc} ${var}\"" fi fi