diff options
Diffstat (limited to 'ezjail.sh')
-rwxr-xr-x | ezjail.sh | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -20,6 +20,7 @@ ezjail_prefix=EZJAIL_PREFIX | |||
20 | 20 | ||
21 | name=ezjail | 21 | name=ezjail |
22 | rcvar=`set_rcvar` | 22 | rcvar=`set_rcvar` |
23 | extra_commands="startcrypto stopcrypto" | ||
23 | load_rc_config ${name} | 24 | load_rc_config ${name} |
24 | 25 | ||
25 | ezjail_enable=${ezjail_enable:-"NO"} | 26 | ezjail_enable=${ezjail_enable:-"NO"} |
@@ -27,6 +28,8 @@ ezjail_enable=${ezjail_enable:-"NO"} | |||
27 | restart_cmd="do_cmd restart _" | 28 | restart_cmd="do_cmd restart _" |
28 | start_cmd="do_cmd start '_ ezjail'" | 29 | start_cmd="do_cmd start '_ ezjail'" |
29 | stop_cmd="do_cmd stop '_ ezjail'" | 30 | stop_cmd="do_cmd stop '_ ezjail'" |
31 | startcrypto_cmd="do_cmd startcrypto _" | ||
32 | stopcrypto_cmd="do_cmd stopcrypto _" | ||
30 | 33 | ||
31 | do_cmd() | 34 | do_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 |