rpe 214644a454 Now that all ports rc.* scripts are using #!/bin/ksh
- change [] tests to [[]]
- change arithmetic [] tests to (())
- change = to == inside [[]]
- remove unecessary quoting inside [[]]

OK aja@
2018-01-14 14:42:18 +00:00

25 lines
557 B
Bash

#!/bin/ksh
#
# $OpenBSD: samba.rc,v 1.12 2018/01/14 14:42:18 rpe Exp $
# "meta" script running the following rc.d(8) scripts with the given argument;
# note that daemon_flags, daemon_user, daemon_timeout 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