When I first plug a drive into the usb (after an install or firstboot) things work great. but after a reboot the init script fails to work. The problem is the line where it tries to turn the MB size into GB
Code: Select all
share_size=$(df | grep "$d" | awk '{ print $2 }')
if [ -z "$share_size" ] ; then share_size="-" ; fi
if [ -n "$share_size" ] ; then share_size=$[(($share_size*1024)) ; fi
I've had to change the line to
Code: Select all
share_size=$(df -h| grep "$d" | awk '{ print $2 }')
if [ -z "$share_size" ] ; then share_size="-" ; fi
if [ -n "$share_size" ] ; then share_size=$share_size ; fi
df -h doesn't work. it converts from bytes to mb so it would need an extra if to see if it was G or M then divide it back? I can't figure out how the web page comes up with its file size: share_size=$(df -h | grep "$d" | awk '{ print $2 }' |sed 's/\(.*\)./\1/' )
comes up with a size in kb.
[/edit]
I
I think that also the /tmp/usb_restart.lock is broken. It never gets removed?
Code: Select all
stop()
{
got_lock=$(usb_lock)
if [ "$got_lock" = "1" ] ; then
do_stop
usb_unlock
fi
}
Code: Select all
stop()
{
got_lock=$(usb_lock)
if [ "$got_lock" = "0" ] ; then
do_stop
usb_unlock
fi
}