diff options
author | 2015-08-01 11:28:14 +0000 | |
---|---|---|
committer | 2015-08-01 11:28:14 +0000 | |
commit | f0ee415b4daa45d31203416d0d8db652f300048a (patch) | |
tree | a4521f2865aee8eec0d9bde1291782bad2e40bd3 | |
parent | Move processing of polled files in its own function, and call it (diff) | |
download | wireguard-openbsd-f0ee415b4daa45d31203416d0d8db652f300048a.tar.xz wireguard-openbsd-f0ee415b4daa45d31203416d0d8db652f300048a.zip |
Tweak needs_root() output.
When using "ls" with a root action, properly output the action and flags
in the error output; from Theo Buehler
-rw-r--r-- | usr.sbin/rcctl/rcctl.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index 1cd3cf7b5ca..db8ed582833 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: rcctl.sh,v 1.76 2015/07/25 04:12:43 ajacoutot Exp $ +# $OpenBSD: rcctl.sh,v 1.77 2015/08/01 11:28:14 ajacoutot Exp $ # # Copyright (c) 2014, 2015 Antoine Jacoutot <ajacoutot@openbsd.org> # Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -34,7 +34,7 @@ usage() needs_root() { - [ "$(id -u)" -ne 0 ] && _rc_err "${0##*/} $1: need root privileges" + [ "$(id -u)" -ne 0 ] && _rc_err "${0##*/}: \"$*\" needs root privileges" } rcctl_err() @@ -485,7 +485,7 @@ case ${action} in ;; ls) # some rc.d(8) scripts need root for rc_check() - [[ ${lsarg} == @(started|stopped|faulty) ]] && needs_root + [[ ${lsarg} == @(started|stopped|faulty) ]] && needs_root ${action} ${lsarg} svc_ls ${lsarg} ;; order) |