|
|
@ -1,4 +1,4 @@ |
|
|
|
# $OpenBSD: rc.subr,v 1.46 2011/09/19 20:41:50 robert Exp $ |
|
|
|
# $OpenBSD: rc.subr,v 1.47 2011/09/22 08:15:01 ajacoutot Exp $ |
|
|
|
# |
|
|
|
# Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org> |
|
|
|
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> |
|
|
@ -24,6 +24,10 @@ rc_err() { |
|
|
|
exit 1 |
|
|
|
} |
|
|
|
|
|
|
|
rc_usage() { |
|
|
|
rc_err "usage: $0 [-df] {start|check|reload|restart|stop}" |
|
|
|
} |
|
|
|
|
|
|
|
rc_start() { |
|
|
|
${rcexec} "${daemon} ${daemon_flags} ${_bg}" |
|
|
|
} |
|
|
@ -130,7 +134,8 @@ rc_cmd() { |
|
|
|
/etc/rc.d/${_name} stop && /etc/rc.d/${_name} start |
|
|
|
;; |
|
|
|
*) |
|
|
|
rc_err "usage: $0 {start|check|reload|restart|stop}" |
|
|
|
rc_usage |
|
|
|
;; |
|
|
|
esac |
|
|
|
} |
|
|
|
|
|
|
@ -138,10 +143,12 @@ rc_cmd() { |
|
|
|
|
|
|
|
[ -n "${daemon}" ] || rc_err "$0: daemon is not set" |
|
|
|
|
|
|
|
unset RC_DEBUG RC_FORCE |
|
|
|
while getopts "df" c; do |
|
|
|
case "$c" in |
|
|
|
d) RC_DEBUG=1;; |
|
|
|
f) RC_FORCE=1;; |
|
|
|
*) rc_usage;; |
|
|
|
esac |
|
|
|
done |
|
|
|
shift $((OPTIND-1)) |
|
|
|