as far as fixing the reboot and halt scripts, I can't help you there. Maybe a google or deja.com search will help?
If you haven't tried the "shutdown" command, maybe that would work better (it always does for me)
to try and reboot the system (you can use the -h flag for halting it).Code:shutdown -r now
Hope this helps some....