diff options
-rwxr-xr-x | ezjail-admin | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/ezjail-admin b/ezjail-admin index 9a68ab0..2b6dcf7 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -33,7 +33,7 @@ case `uname -p` in amd64) ezjail_dirlist="${ezjail_dirlist} usr/lib32";; esac | |||
33 | 33 | ||
34 | # Synopsis messages | 34 | # Synopsis messages |
35 | ezjail_usage_ezjailadmin="Usage: `basename -- $0` [config|create|delete|install|list|update] {params}" | 35 | ezjail_usage_ezjailadmin="Usage: `basename -- $0` [config|create|delete|install|list|update] {params}" |
36 | ezjail_usage_create="Usage: `basename -- $0` create [-xbi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli] [-u passurl] [-C args] jailname jailip" | 36 | ezjail_usage_create="Usage: `basename -- $0` create [-xbi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli] [-C args] jailname jailip" |
37 | ezjail_usage_delete="Usage: `basename -- $0` delete [-w] jailname" | 37 | ezjail_usage_delete="Usage: `basename -- $0` delete [-w] jailname" |
38 | ezjail_usage_list="Usage: `basename -- $0` list" | 38 | ezjail_usage_list="Usage: `basename -- $0` list" |
39 | ezjail_usage_update="Usage: `basename -- $0` update [-s sourcetree] [-i] [-pP]" | 39 | ezjail_usage_update="Usage: `basename -- $0` update [-s sourcetree] [-i] [-pP]" |
@@ -85,7 +85,6 @@ fetchjailinfo () { | |||
85 | eval ezjail_attachparams=\"\$jail_${ezjail_safename}_attachparams\" | 85 | eval ezjail_attachparams=\"\$jail_${ezjail_safename}_attachparams\" |
86 | eval ezjail_attachblocking=\"\$jail_${ezjail_safename}_attachblocking\" | 86 | eval ezjail_attachblocking=\"\$jail_${ezjail_safename}_attachblocking\" |
87 | eval ezjail_forceblocking=\"\$jail_${ezjail_safename}_forceblocking\" | 87 | eval ezjail_forceblocking=\"\$jail_${ezjail_safename}_forceblocking\" |
88 | eval ezjail_passphraseurl=\"\$jail_${ezjail_safename}_passphraseurl\" | ||
89 | 88 | ||
90 | ezjail_softlink=${ezjail_jaildir}/`basename -- ${ezjail_rootdir}` | 89 | ezjail_softlink=${ezjail_jaildir}/`basename -- ${ezjail_rootdir}` |
91 | 90 | ||
@@ -163,8 +162,8 @@ case "$1" in | |||
163 | ######################## ezjail-admin CREATE ######################## | 162 | ######################## ezjail-admin CREATE ######################## |
164 | create) | 163 | create) |
165 | # Clean variables, prevent polution | 164 | # Clean variables, prevent polution |
166 | unset ezjail_rootdir ezjail_flavour ezjail_softlink ezjail_image ezjail_imagetype ezjail_imageparams ezjail_imagesize ezjail_device ezjail_config ezjail_attachparams ezjail_passphraseurl ezjail_exists ezjail_attachblocking ezjail_forceblocking | 165 | unset ezjail_rootdir ezjail_flavour ezjail_softlink ezjail_image ezjail_imagetype ezjail_imageparams ezjail_imagesize ezjail_device ezjail_config ezjail_attachparams ezjail_exists ezjail_attachblocking ezjail_forceblocking |
167 | shift; while getopts :f:r:s:xbic:u:C: arg; do case ${arg} in | 166 | shift; while getopts :f:r:s:xbic:C: arg; do case ${arg} in |
168 | x) ezjail_exists="YES";; | 167 | x) ezjail_exists="YES";; |
169 | r) ezjail_rootdir="${OPTARG}";; | 168 | r) ezjail_rootdir="${OPTARG}";; |
170 | f) ezjail_flavour="${OPTARG}";; | 169 | f) ezjail_flavour="${OPTARG}";; |
@@ -173,7 +172,6 @@ create) | |||
173 | b) ezjail_forceblocking="YES";; | 172 | b) ezjail_forceblocking="YES";; |
174 | i) ezjail_imagetype=${ezjail_imagetype:-"simple"};; | 173 | i) ezjail_imagetype=${ezjail_imagetype:-"simple"};; |
175 | s) ezjail_imagesize="${OPTARG}";; | 174 | s) ezjail_imagesize="${OPTARG}";; |
176 | u) ezjail_urlpass="${OPTARG}";; | ||
177 | ?) exerr ${ezjail_usage_create};; | 175 | ?) exerr ${ezjail_usage_create};; |
178 | esac; done; shift $(( ${OPTIND} - 1 )) | 176 | esac; done; shift $(( ${OPTIND} - 1 )) |
179 | 177 | ||
@@ -271,7 +269,7 @@ create) | |||
271 | case "${ezjail_imagetype}" in | 269 | case "${ezjail_imagetype}" in |
272 | bde|eli) | 270 | bde|eli) |
273 | # parse imageparams, generate attachparams | 271 | # parse imageparams, generate attachparams |
274 | [ -n "${ezjail_passphraseurl}" ] || ezjail_attachblocking="YES" | 272 | ezjail_attachblocking="YES" |
275 | if [ -n "${ezjail_imageparams}" ]; then | 273 | if [ -n "${ezjail_imageparams}" ]; then |
276 | ezjail_attachparams=`echo $0 _parse_g${ezjail_imagetype}_attach_args_ ${ezjail_imageparams} | /bin/sh ` | 274 | ezjail_attachparams=`echo $0 _parse_g${ezjail_imagetype}_attach_args_ ${ezjail_imageparams} | /bin/sh ` |
277 | [ 5 -eq $? ] && exerr "processing of ezjail_imageparams failed" | 275 | [ 5 -eq $? ] && exerr "processing of ezjail_imageparams failed" |
@@ -342,7 +340,6 @@ create) | |||
342 | echo export jail_${ezjail_safename}_attachparams=\"${ezjail_attachparams}\" >> ${ezjail_config} | 340 | echo export jail_${ezjail_safename}_attachparams=\"${ezjail_attachparams}\" >> ${ezjail_config} |
343 | echo export jail_${ezjail_safename}_attachblocking=\"${ezjail_attachblocking}\" >> ${ezjail_config} | 341 | echo export jail_${ezjail_safename}_attachblocking=\"${ezjail_attachblocking}\" >> ${ezjail_config} |
344 | echo export jail_${ezjail_safename}_forceblocking=\"${ezjail_forceblocking}\" >> ${ezjail_config} | 342 | echo export jail_${ezjail_safename}_forceblocking=\"${ezjail_forceblocking}\" >> ${ezjail_config} |
345 | echo export jail_${ezjail_safename}_passphraseurl=\"${ezjail_passphraseurl}\" >> ${ezjail_config} | ||
346 | 343 | ||
347 | # Final steps for flavour installation | 344 | # Final steps for flavour installation |
348 | if [ -z "${ezjail_exists}" -a -n "${ezjail_flavour}" ]; then | 345 | if [ -z "${ezjail_exists}" -a -n "${ezjail_flavour}" ]; then |
@@ -378,8 +375,6 @@ create) | |||
378 | [ $? = 0 ] && echo -e "Warning: Some services already seem to be listening on all IP, (including ${ezjail_ip})\n This may cause some confusion, here they are:\n${ezjail_listener}" | 375 | [ $? = 0 ] && echo -e "Warning: Some services already seem to be listening on all IP, (including ${ezjail_ip})\n This may cause some confusion, here they are:\n${ezjail_listener}" |
379 | IFS=${TIFS} | 376 | IFS=${TIFS} |
380 | 377 | ||
381 | [ -n "${ezjail_passphraseurl}" ] && echo -e "You specified a passphrase file location ${ezjail_passphraseurl}\nThis will be fetched by ezjail.sh when auto-running this jail. The file should contain a line in the form\njail_${ezjail_safename}_passphrase=YOURPASSPHRASE\n. If fetching fails or the file does not contain that line, the jail ${ezjail_name} will not be started, even if no passphrase was necessary." | ||
382 | |||
383 | ;; | 378 | ;; |
384 | ######################## ezjail-admin DELETE ######################## | 379 | ######################## ezjail-admin DELETE ######################## |
385 | delete) | 380 | delete) |
@@ -603,7 +598,7 @@ config) | |||
603 | case ${ezjail_imagetype} in | 598 | case ${ezjail_imagetype} in |
604 | crypto|bde) | 599 | crypto|bde) |
605 | echo "Attaching bde device for image jail ${ezjail}..." | 600 | echo "Attaching bde device for image jail ${ezjail}..." |
606 | echo gbde attach /dev/${ezjail_imagedevice} ${ezjail_attachparams} | /bin/sh | 601 | echo gbde attach /dev/${ezjail_imagedevice} ${ezjail_attachparams} | /bin/sh |
607 | [ $? -eq 0 ] || detach_images keep || exerr "Error: Attaching bde device failed." | 602 | [ $? -eq 0 ] || detach_images keep || exerr "Error: Attaching bde device failed." |
608 | # Device to mount is not md anymore | 603 | # Device to mount is not md anymore |
609 | ezjail_device=${ezjail_imagedevice}.bde | 604 | ezjail_device=${ezjail_imagedevice}.bde |