I am having some oddball issues with bash scripting and I am unsure what is
going on. First off, let me post my current script:

#!/bin/bash
while [ "$imput" != "0" ]
do
clear

echo "******************************************"
echo " Centimark Image Menu "
echo "******************************************"
echo ""
echo ""
echo "[1] Image Laptop"
echo "[2] Image Desktop"
echo "[3] Clean Image"
echo "[4] Exit to Bash"
echo "[5] Reboot Machine"
read input

case $input in

"1")
hdparm -d1 /dev/hda
img pd-all
img pc1 ntfs
img pa1
img rp $PROXYADDR //$PROXYADDR/zen/images/base.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/drivers.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/apps.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/lapsysprep.zmg
if [ `hwinfo --smp | grep -ic 'yes'` = "1" ]; then img rp $PROXYADDR
//$PROXYADDR/zen/images/multihal.zmg ; fi
reboot
break
;;

"2")
hdparm -d1 /dev/hda
img pd-all
img pc1 ntfs
img pa1
img rp $PROXYADDR //$PROXYADDR/zen/images/base.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/drivers.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/apps.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/desksysprep.zmg
if [ `hwinfo --smp | grep -ic 'yes'` = "1" ]; then img rp $PROXYADDR
//$PROXYADDR/zen/images/multihal.zmg ; fi
reboot
break
;;

"3")
hdparm -d1 /dev/hda
img pd-all
img pc1 ntfs
img pa1
img rp $PROXYADDR //$PROXYADDR/zen/images/base.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/drivers.zmg
img rp $PROXYADDR //$PROXYADDR/zen/images/desksysprep.zmg
if [ `hwinfo --smp | grep -ic 'yes'` = "1" ]; then img rp $PROXYADDR
//$PROXYADDR/zen/images/multihal.zmg ; fi
reboot
;;

"4")
clear
ash -rcfile /bin/bashrc
exit 0
;;

"5")
reboot
;;

easac
done
exit 0



This is an alteration from the script put in the cool solutions article. A
few problems though. The script seems to barf at line 59 with the problem
of "sytax error near unexpected token ')'. That is the line with the "4").
If i kill the 4 and the 5 sections out of the script, all runs fine.
What is different about that section than the rest of it?

Secondly, reboot doesn't seem to work while inside the script. It pops up
an error at the point about reboot not being right and attempting to do a
soft reboot. Then it complains about not having rights to do so or not
being able to find certain files. If you type reboot at bash, it does it
fine. The scripts seem to be owned by root, so I don't see a rights issue.
Also clear is effected by the same problem (works at bash, not in script).

Lastly, what the heck is the easac part of the script? I can't find any
info on that and why it is there.


Help Please :)