#!/bin/sh
#
# $OpenBSD: bacula.rc,v 1.1 2013/05/03 18:40:32 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.

if [ "$1" = stop ]; then
	# stop the FD first so that SD will fail jobs and update catalog
	_pkg_scripts="bacula_fd bacula_sd bacula_dir"
else
	_pkg_scripts="bacula_sd bacula_fd bacula_dir"
fi

for _i in ${_pkg_scripts}; do [[ -x /etc/rc.d/${_i} ]] && /etc/rc.d/${_i} $1; done
