summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-24 13:46:58 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-24 13:46:58 +0000
commit2c2481497cae26a1a779ee7803ebd792d383d73e (patch)
treeb89179b6941cb11b925147edb8838c22aaa36bf9 /usr.sbin
parent2682e8adb830b981448710d349c44cf99750a731 (diff)
reduce indentation of main program by one tab, no functional change
ok ajacoutot@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rcctl/rcctl.sh96
1 files changed, 48 insertions, 48 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index 4e4b01c1f3a..c4faf934cee 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.14 2014/08/24 08:13:15 ajacoutot Exp $
+# $OpenBSD: rcctl.sh,v 1.15 2014/08/24 13:46:57 schwarze Exp $
#
# Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -286,59 +286,59 @@ while getopts "df" c; do
done
shift $((OPTIND-1))
+[ $# -gt 0 ] || usage
+
action=$1
svc=$2
flag=$3
flags=$*
-if [ $# -gt 0 ]; then
- if [ -n "$svc" ]; then
- if ! svc_is_avail $svc; then
- _rc_err "service $svc does not exist"
- fi
- elif [ "$action" != "status" ]; then
- usage
+if [ -n "$svc" ]; then
+ if ! svc_is_avail $svc; then
+ _rc_err "service $svc does not exist"
fi
- if [ -n "$flag" ]; then
- if [ "$flag" = "flags" ]; then
- if [ "$action" != "enable" ]; then
- _rc_err "\"flags\" can only be set with \"enable\""
- fi
- if svc_is_special $svc; then
- _rc_err "\"$svc\" is a special variable, cannot set \"flags\""
- fi
- else
- usage
+elif [ "$action" != "status" ]; then
+ usage
+fi
+
+if [ -n "$flag" ]; then
+ if [ "$flag" = "flags" ]; then
+ if [ "$action" != "enable" ]; then
+ _rc_err "\"flags\" can only be set with \"enable\""
+ fi
+ if svc_is_special $svc; then
+ _rc_err "\"$svc\" is a special variable, cannot set \"flags\""
fi
+ else
+ usage
fi
- case $action in
- disable)
- needs_root $action
- if ! svc_is_base $svc && ! svc_is_special $svc; then
- rm_from_pkg_scripts $svc
- fi
- rm_flags $svc
- ;;
- enable)
- needs_root $action
- add_flags $flags
- if ! svc_is_base $svc && ! svc_is_special $svc; then
- append_to_pkg_scripts $svc
- fi
- ;;
- status)
- svc_get_status $svc
- ;;
- start|stop|restart|reload|check)
- if svc_is_special $svc; then
- _rc_err "\"$svc\" is a special variable, no rc.d(8) script"
- fi
- /etc/rc.d/$svc ${_RC_DEBUG} ${_RC_FORCE} $action
- ;;
- *)
- usage
- ;;
- esac
-else
- usage
fi
+
+case $action in
+ disable)
+ needs_root $action
+ if ! svc_is_base $svc && ! svc_is_special $svc; then
+ rm_from_pkg_scripts $svc
+ fi
+ rm_flags $svc
+ ;;
+ enable)
+ needs_root $action
+ add_flags $flags
+ if ! svc_is_base $svc && ! svc_is_special $svc; then
+ append_to_pkg_scripts $svc
+ fi
+ ;;
+ status)
+ svc_get_status $svc
+ ;;
+ start|stop|restart|reload|check)
+ if svc_is_special $svc; then
+ _rc_err "\"$svc\" is a special variable, no rc.d(8) script"
+ fi
+ /etc/rc.d/$svc ${_RC_DEBUG} ${_RC_FORCE} $action
+ ;;
+ *)
+ usage
+ ;;
+esac