summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-08-24 18:10:26 +0000
committerschwarze <schwarze@openbsd.org>2014-08-24 18:10:26 +0000
commita85c0de1f87f1c3450ef8c4a341b050d07356368 (patch)
treea802e0303bca9dece0ad7b9935771bf7a83afe02
parentFix wrong IEEE 802.11 ioctl's: (diff)
downloadwireguard-openbsd-a85c0de1f87f1c3450ef8c4a341b050d07356368.tar.xz
wireguard-openbsd-a85c0de1f87f1c3450ef8c4a341b050d07356368.zip
Start all error messages with "rcctl: " such that it is clear where
they come from. While here, there is no need to check the argument of needs_root() before displaying it, it is always provided. ok ajacoutot@ jasper@
-rw-r--r--usr.sbin/rcctl/rcctl.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index cd172d6083f..19e3301fc8f 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.17 2014/08/24 17:52:38 ajacoutot Exp $
+# $OpenBSD: rcctl.sh,v 1.18 2014/08/24 18:10:26 schwarze Exp $
#
# Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -29,7 +29,7 @@ usage()
needs_root()
{
if [ "$(id -u)" -ne 0 ]; then
- _rc_err "${0##*/} ${1:+$1: }need root privileges"
+ _rc_err "${0##*/} $1: need root privileges"
fi
}
@@ -292,7 +292,7 @@ flags=$*
if [ -n "$svc" ]; then
if ! svc_is_avail $svc; then
- _rc_err "service $svc does not exist"
+ _rc_err "${0##*/}: service $svc does not exist"
fi
elif [ "$action" != "status" ]; then
usage
@@ -301,10 +301,10 @@ fi
if [ -n "$flag" ]; then
if [ "$flag" = "flags" ]; then
if [ "$action" != "enable" ]; then
- _rc_err "\"flags\" can only be set with \"enable\""
+ _rc_err "${0##*/}: \"flags\" can only be set with \"enable\""
fi
if svc_is_special $svc; then
- _rc_err "\"$svc\" is a special variable, cannot set \"flags\""
+ _rc_err "${0##*/}: \"$svc\" is a special variable, cannot set \"flags\""
fi
else
usage
@@ -331,7 +331,7 @@ case $action in
;;
start|stop|restart|reload|check)
if svc_is_special $svc; then
- _rc_err "\"$svc\" is a special variable, no rc.d(8) script"
+ _rc_err "${0##*/}: \"$svc\" is a special variable, no rc.d(8) script"
fi
/etc/rc.d/$svc ${_RC_DEBUG} ${_RC_FORCE} $action
;;