summaryrefslogtreecommitdiff
path: root/usr.sbin/rcctl/rcctl.sh
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2015-08-01 11:28:15 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2015-08-01 11:28:15 +0000
commit9784c37f110d468d1ff6d24c2247d884dc258983 (patch)
tree4d690e8ab84a5938472255422d22638787b9e9a9 /usr.sbin/rcctl/rcctl.sh
parentc8e171f77a624703659164350967d11ad2a5474a (diff)
Tweak needs_root() output.
When using "ls" with a root action, properly output the action and flags in the error output; from Theo Buehler
Diffstat (limited to 'usr.sbin/rcctl/rcctl.sh')
-rw-r--r--usr.sbin/rcctl/rcctl.sh6
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)