Corrected a bug where a jail_list in rc.conf prevented ezjail to start up its own jails

This commit is contained in:
erdgeist 2006-03-06 18:18:33 +00:00
parent e4ef7d9051
commit 7e299c2c86

View File

@ -28,18 +28,19 @@ stop_cmd="do_cmd stop '_ ezjail'"
do_cmd() do_cmd()
{ {
action=$1; message=$2; shift 2; action=$1; message=$2; shift 2;
[ -n "$*" ] && jail_list=`echo -n $* | tr -c "[:alnum:] " _` || echo -n "${message##_}" ezjail_list=
jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`} [ -n "$*" ] && ezjail_list=`echo -n $* | tr -c "[:alnum:] " _` || echo -n "${message##_}"
jail_pass= ezjail_list=${ezjail_list:-`ls ${ezjail_prefix}/etc/ezjail/`}
for jail in ${jail_list}; do ezjail_pass=
if [ -f ${ezjail_prefix}/etc/ezjail/${jail} ]; then for ezjail in ${ezjail_list}; do
. ${ezjail_prefix}/etc/ezjail/${jail} if [ -f ${ezjail_prefix}/etc/ezjail/${ezjail} ]; then
jail_pass="${jail_pass} ${jail}" . ${ezjail_prefix}/etc/ezjail/${ezjail}
ezjail_pass="${ezjail_pass} ${ezjail}"
else else
echo " Warning: Jail ${jail} not found." echo " Warning: Jail ${ezjail} not found."
fi fi
done done
[ "${jail_pass}" ] && sh /etc/rc.d/jail one${action} ${jail_pass} [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action} ${ezjail_pass}
} }
run_rc_command $* run_rc_command $*