sthen e56d2db445 Adjust the "meta" rc-scripts (these are used in ports with multiple daemons
which should all be started/stopped together), previously "restart" would
restart each sub-daemon in turn, but actually it should stop all daemons
and only then start them again. Additionally, as suggested by ajacoutot,
stop the procedure and return an error if stopping one of the rc scripts
failed.  ok ajacoutot@ rpe@
2015-02-17 22:08:36 +00:00

25 lines
539 B
Bash

#!/bin/sh
#
# $OpenBSD: samba.rc,v 1.9 2015/02/17 22:08:36 sthen Exp $
# "meta" script running the following rc.d(8) scripts with the given argument;
# note that daemon_flags, daemon_user and daemon_class are not passed to
# the child scripts.
_pkg_scripts="smbd nmbd"
if [ "$1" = restart ]; then
$0 stop && $0 start
exit
fi
if [ "$1" = stop ]; then
for _i in ${_pkg_scripts}; do _l="${_i} ${_l}"; done
_pkg_scripts=${_l% }
fi
for _i in ${_pkg_scripts}; do
if [[ -x ${RCDIR}/${_i} ]]; then
${RCDIR}/${_i} $@ || exit $?
fi
done