i have found a simple bash script and am trying to make it do things my way.
i have modified it quite a lot and,
i am obviously doing something wrong. can you help?
#!/bin/bash
clear
echo "##################################"
echo " Image menu"
echo "##################################"
echo ""
echo ""
echo "[1] Restore Image"
echo "[2] Restore ONLY C: Drive"
echo "[3] Create Image"
echo "[0] quit"
read input
case $input in
"1" )
echo "Please enter image name"
echo "[1] Dx2000mt"
echo "[2] D31v"
echo "[3] D230m"
echo "[4] D330m"
read input
case $input in
"a" )
img pd1
img pd2
img pd3
img pd4
hdparm -d1 /dev/hda
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp001.zmg
img pc2 ntfs
img pa1
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/ddrive.zmg a1
1
reboot
break
;;
"b" )
img pd1
img pd2
img pd3
img pd4
hdparm -d1 /dev/hda
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp002.zmg
img pc2 ntfs
img pa1
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/ddrive.zmg a1
1
reboot
break
;;
"c" )
img pd1
img pd2
img pd3
img pd4
hdparm -d1 /dev/hda
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp003.zmg
img pc2 ntfs
img pa1
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/ddrive.zmg a1
1
reboot
break
;;
"d" )
img pd1
img pd2
img pd3
img pd4
hdparm -d1 /dev/hda
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp004.zmg
img pc2 ntfs
img pa1
img 10.1.80.3 //hct-cluster2/zenimages/images/xp/ddrive.zmg a1
1
reboot
break
;;
"2" )
echo "Please enter image name"
echo "[a] Dx2000mt"
echo "[b] D31v"
echo "[c] D230m"
echo "[d] D330m"
read input
case $input in
"a" )
hdparm -d1 /dev/hda
img rp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp001.zmg
reboot
break
;;
"b" )
hdparm -d1 /dev/hda
img rp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp002.zmg
reboot
break
;;
"c" )
hdparm -d1 /dev/hda
img rp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp003.zmg
reboot
break
;;
"d" )
hdparm -d1 /dev/hda
img rp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp003.zmg
reboot
break
;;
"3" )
echo "Please enter image name"
echo "[a] Dx2000mt"
echo "[b] D31v"
echo "[c] D230m"
echo "[d] D330m"
read input
case $input in
"a" )
hdparm -d1 /dev/hda
img mp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp001.zmg
reboot
break
;;
"b" )
hdparm -d1 /dev/hda
img mp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp002.zmg
reboot
break
;;
"c" )
hdparm -d1 /dev/hda
img mp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp003.zmg
reboot
break
;;
"d" )
hdparm -d1 /dev/hda
img mp 10.1.80.3 //hct-cluster2/zenimages/images/xp/xp-hp003.zmg
reboot
break
;;
"0")
clear
ash -rcfile /bin/bashrc
break
;;
esac
done
exit 0
thanks in advance
BoX