ports/sysutils/iocage/files/iocage.in
Marcelo Araujo ef48078bcc Rename py3-iocage to iocage as by now we don't have more conflicts with
the old iocage version and also in favor of python flavors that will
land soon, it makes sense to do it now.

Sponsored by:	iXsystems, Inc.
2017-10-03 02:41:32 +00:00

47 lines
763 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: iocage
# REQUIRE: LOGIN cleanvar sshd ZFS
# BEFORE: securelevel
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable iocage:
#
# iocage_enable="YES"
#
#
. /etc/rc.subr
name="iocage"
rcvar=iocage_enable
# read configuration and set defaults
load_rc_config "$name"
: ${iocage_enable="NO"}
: ${iocage_lang="en_US.UTF-8"}
start_cmd="iocage_start"
stop_cmd="iocage_stop"
export LANG=$iocage_lang
iocage_start()
{
if checkyesno ${rcvar}; then
echo "* [I|O|C] starting jails... "
/usr/local/bin/iocage start --rc
fi
}
iocage_stop()
{
if checkyesno ${rcvar}; then
echo "* [I|O|C] stopping jails... "
/usr/local/bin/iocage stop --rc
fi
}
run_rc_command "$1"