summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2006-05-15 19:50:22 +0000
committererdgeist <erdgeist@erdgeist.org>2006-05-15 19:50:22 +0000
commit43f3679ff52db9ee475ae25d3366a6ef3360ebda (patch)
tree2e95dc38c6629f4689bbae85dd3defc9160f5113 /ezjail-admin
parent783782f20380e0799ca09c5d55529896fb18650e (diff)
sh arithmetic overflows, use bc to calculate image size
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin4
1 files changed, 2 insertions, 2 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 6d5cb8e..dbf44e6 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -191,8 +191,8 @@ create)
191 _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:*:` 191 _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:*:`
192 _val=`echo ${_val} | bc` 192 _val=`echo ${_val} | bc`
193 [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})." 193 [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})."
194 ezjail_imageblockcount=$(( ${_val} / 1048576 )) 194 ezjail_imageblockcount=`echo ${_val} / 1048576 | bc`
195 ezjail_imagerestbytes=$(( ${_val} % 1048576 )) 195 ezjail_imagerestbytes=`echo ${_val} % 1048576 | bc`
196 fi 196 fi
197 197
198 # check, whether ezjail-update has been called. existence of 198 # check, whether ezjail-update has been called. existence of