0.3.20181112 template support

This commit is contained in:
Christer Edwards
2018-11-13 10:38:33 -07:00
parent 117dec28b9
commit 7700b9beff
25 changed files with 218 additions and 31 deletions

View File

@@ -0,0 +1,10 @@
## [ BastilleBSD ] ##
#####################
## default paths
bastille_prefix=/usr/local/bastille
bastille_cachedir=${bastille_prefix}/cache
bastille_jailsdir=${bastille_prefix}/jails
bastille_logsdir=${bastille_prefix}/logs
bastille_releasesdir=${bastille_prefix}/releases
bastille_sharedir=/usr/local/share/bastille

View File

@@ -0,0 +1,65 @@
#!/bin/sh
# $FreeBSD: $
#
# Bastille startup script
#
# PROVIDE: bastille
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following to /etc/rc.conf[.local] to enable this service
#
# bastille_enable (bool): Set to NO by default.
# Set it to YES to enable bastille.
# bastille_list (string): Set to "" by default.
# Space separated list of jails to start.
#
. /etc/rc.subr
name=bastille
rcvar=bastille_enable
load_rc_config ${name}
: ${bastille_enable:=NO}
: ${bastille_list:=""}
start_cmd=bastille_start
stop_cmd=bastille_stop
start_command="%%$PREFIX%%/bin/bastille start"
stop_command="%%$PREFIX%%/bin/bastille stop"
bastille_start()
{
if [ ! -n "${bastille_list}" ]; then
echo "${bastille_list} is undefined"
return 1
fi
local _jail
for _jail in ${bastille_list}; do
echo "Starting Bastille Jail: ${_jail}"
${start_command} ${_jail}
done
}
bastille_stop()
{
if [ ! -n "${bastille_list}" ]; then
echo "${bastille_list} is undefined"
return 1
fi
local _jail
for _jail in ${bastille_list}; do
echo "Stopping Bastille Jail: ${_jail}"
${stop_command} ${_jail}
done
}
run_rc_command "$1"