diff options
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-x | ezjail-admin | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ezjail-admin b/ezjail-admin index 51df80f..0f68e7b 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -71,7 +71,7 @@ fetchjailinfo () { | |||
71 | # Clean variables, prevent polution | 71 | # Clean variables, prevent polution |
72 | unset ezjail_config ezjail_running ezjail_hostname ezjail_rootdir ezjail_image ezjail_imagetype ezjail_ip ezjail_id ezjail_attached ezjail_device | 72 | unset ezjail_config ezjail_running ezjail_hostname ezjail_rootdir ezjail_image ezjail_imagetype ezjail_ip ezjail_id ezjail_attached ezjail_device |
73 | 73 | ||
74 | ezjail_safename=`echo -n "${ezjail_name}" | tr -c [:alnum:] _` | 74 | ezjail_safename=`echo -n "${ezjail_name}" | tr -c '[:alnum:]' _` |
75 | 75 | ||
76 | [ -e ${ezjail_jailcfgs}/${ezjail_safename} ] && ezjail_config=${ezjail_jailcfgs}/${ezjail_safename} | 76 | [ -e ${ezjail_jailcfgs}/${ezjail_safename} ] && ezjail_config=${ezjail_jailcfgs}/${ezjail_safename} |
77 | [ -e ${ezjail_jailcfgs}/${ezjail_safename}.norun ] && ezjail_config=${ezjail_jailcfgs}/${ezjail_safename}.norun | 77 | [ -e ${ezjail_jailcfgs}/${ezjail_safename}.norun ] && ezjail_config=${ezjail_jailcfgs}/${ezjail_safename}.norun |
@@ -210,7 +210,7 @@ create) | |||
210 | 210 | ||
211 | # check for a sane image size and split it up in blocks | 211 | # check for a sane image size and split it up in blocks |
212 | if [ "${ezjail_imagesize}" ]; then | 212 | if [ "${ezjail_imagesize}" ]; then |
213 | _val=`echo "${ezjail_imagesize}"|tr A-Z a-z|sed -Ees:g:km:g -es:m:kk:g -es:k:*2b:g -es:b:*128w:g -es:w:*4\ :g -e"s:(^|[^0-9])0x:\1\0X:g" -ey:x:*:|bc` | 213 | _val=`echo "${ezjail_imagesize}"|tr GMKBWX gmkbwx|sed -Ees:g:km:g -es:m:kk:g -es:k:*2b:g -es:b:*128w:g -es:w:*4\ :g -e"s:(^|[^0-9])0x:\1\0X:g" -ey:x:*:|bc` |
214 | [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})." | 214 | [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})." |
215 | ezjail_imageblockcount=`echo ${_val} / 1048576 | bc` | 215 | ezjail_imageblockcount=`echo ${_val} / 1048576 | bc` |
216 | ezjail_imagerestbytes=`echo ${_val} % 1048576 | bc` | 216 | ezjail_imagerestbytes=`echo ${_val} % 1048576 | bc` |
@@ -227,8 +227,8 @@ create) | |||
227 | # was done intentionally to permit foo.com style directory names, however, | 227 | # was done intentionally to permit foo.com style directory names, however, |
228 | # the jail name will be foo_com in most scripts | 228 | # the jail name will be foo_com in most scripts |
229 | 229 | ||
230 | ezjail_hostname=`echo -n ${ezjail_name} | tr /~ __` | 230 | ezjail_hostname=`echo -n ${ezjail_name} | tr '/~' '__'` |
231 | ezjail_safename=`echo -n "${ezjail_name}" | tr -c [:alnum:] _` | 231 | ezjail_safename=`echo -n "${ezjail_name}" | tr -c '[:alnum:]' _` |
232 | ezjail_rootdir=${ezjail_rootdir:-"${ezjail_jaildir}/${ezjail_hostname}"} | 232 | ezjail_rootdir=${ezjail_rootdir:-"${ezjail_jaildir}/${ezjail_hostname}"} |
233 | ezjail_config=${ezjail_jailcfgs}/${ezjail_safename} | 233 | ezjail_config=${ezjail_jailcfgs}/${ezjail_safename} |
234 | 234 | ||