summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xezjail.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/ezjail.sh b/ezjail.sh
index b081bbf..41a4ca8 100755
--- a/ezjail.sh
+++ b/ezjail.sh
@@ -20,6 +20,7 @@ ezjail_prefix=EZJAIL_PREFIX
20 20
21name=ezjail 21name=ezjail
22rcvar=`set_rcvar` 22rcvar=`set_rcvar`
23extra_commands="startcrypto stopcrypto"
23load_rc_config ${name} 24load_rc_config ${name}
24 25
25ezjail_enable=${ezjail_enable:-"NO"} 26ezjail_enable=${ezjail_enable:-"NO"}
@@ -27,6 +28,8 @@ ezjail_enable=${ezjail_enable:-"NO"}
27restart_cmd="do_cmd restart _" 28restart_cmd="do_cmd restart _"
28start_cmd="do_cmd start '_ ezjail'" 29start_cmd="do_cmd start '_ ezjail'"
29stop_cmd="do_cmd stop '_ ezjail'" 30stop_cmd="do_cmd stop '_ ezjail'"
31startcrypto_cmd="do_cmd startcrypto _"
32stopcrypto_cmd="do_cmd stopcrypto _"
30 33
31do_cmd() 34do_cmd()
32{ 35{
@@ -63,6 +66,9 @@ do_cmd()
63 # Cannot auto mount crypto jails without interrupting boot process 66 # Cannot auto mount crypto jails without interrupting boot process
64 [ "${ezjail_fromrc}" = "YES" -a "${ezjail_crypt}" = "YES" -a "${action}" = "start" ] && continue 67 [ "${ezjail_fromrc}" = "YES" -a "${ezjail_crypt}" = "YES" -a "${action}" = "start" ] && continue
65 68
69 # Explicitely do only run crypto jails
70 [ "${action%crypto}" != "${action}" -a "${ezjail_crypt}" = "YES" ] && continue
71
66 # Try to attach (crypto) devices 72 # Try to attach (crypto) devices
67 [ "${ezjail_image}" ] && attach_detach_pre 73 [ "${ezjail_image}" ] && attach_detach_pre
68 74
@@ -70,7 +76,7 @@ do_cmd()
70 done 76 done
71 77
72 # Pass control to jail script which does the actual work 78 # Pass control to jail script which does the actual work
73 [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action} ${ezjail_pass} 79 [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass}
74 80
75 # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail) 81 # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail)
76 attach_detach_post 82 attach_detach_post