summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2006-07-15 16:11:22 +0000
committererdgeist <erdgeist@erdgeist.org>2006-07-15 16:11:22 +0000
commit5b5921370d821cef89194a628b1942af382aedfb (patch)
tree093f075c79b5b61c94b4ec820ceb3e37d49049aa /ezjail-admin
parent372d2696dfb6296b08f8d7b55d39fff82e8ab63e (diff)
Fixed some expansion/quotation issues with tr's parameters ([:alnum:] etc.) Thanks to Simon L. Nielsen.
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin8
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