summaryrefslogtreecommitdiff
path: root/ezjail.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ezjail.sh')
-rwxr-xr-xezjail.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/ezjail.sh b/ezjail.sh
new file mode 100755
index 0000000..9e59dc2
--- /dev/null
+++ b/ezjail.sh
@@ -0,0 +1,53 @@
1#/bin/sh
2
3# $FreeBSD$
4#
5# PROVIDE: ezjail
6#
7# Note: Add the following lines to $PREFIX/etc/rc.conf to enable ezjail,
8#
9#ezjail_enable="YES"
10#
11# Please do not change this file, configure in $PREFIX/etc/ezjail.conf
12
13# ugly: this variable will be set on port install time
14ezjail_prefix=EZJAIL_PREFIX
15
16. /etc/rc.subr
17
18name=ezjail
19rcvar=`set_rcvar`
20load_rc_config $name
21
22ezjail_enable=${ezjail_enable:-"NO"}
23
24restart_cmd="do_restart"
25start_cmd="do_start"
26stop_cmd="do_stop"
27
28do_start()
29{
30 [ -n "$*" ] && jail_list=`echo $* | tr /~. ___` || echo " ezjail"
31 jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`}
32 for jail in $jail_list; do . ${ezjail_prefix}/etc/ezjail/${jail}; done
33 sh /etc/rc.d/jail onestart $jail_list
34}
35
36do_restart()
37{
38 [ -n "$*" ] && jail_list=`echo $* | tr /~. ___`;
39 jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`}
40 for jail in $jail_list; do . ${ezjail_prefix}/etc/ezjail/${jail}; done
41 sh /etc/rc.d/jail onestop $jail_list
42 sh /etc/rc.d/jail onestart $jail_list
43}
44
45do_stop()
46{
47 [ -n "$*" ] && jail_list=`echo $* | tr /~. ___` || echo " ezjail"
48 jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`}
49 for jail in $jail_list; do . ${ezjail_prefix}/etc/ezjail/${jail}; done
50 sh /etc/rc.d/jail onestop $jail_list
51}
52
53run_rc_command $*