d*** bash scripts
I posted a while ago that I was making a bash script. Well I managed to get it to do exactly what I wanted. But I now have a problem, this is my output:
Starting Printer configuration <--good
Starting MSN messenger <--good
Loading Webcam Module.... <--yes fine
start.sh: line 16: insmod: command not found <--okay not root
Georges Sharp Zaurus SL5000/SL5500 Initialisation Script v1.0 <--good
echo You MUST be root or su to use this script. <---urgh
echo Loading USBDNET <--what is happening here
echo Dont worry too much about WARNING messages!
Or that the module already exists
start.sh: line 26: insmod: command not found
Initializing Sharp Zaurus!
Attempting to add a route to your Zaurus!
If you see an error message wait until the script has finished
start.sh: line 106: unexpected EOF while looking for matching `''
start.sh: line 126: syntax error: unexpected end of file <--ahhhh!!
If you paste this into vi, you will see that line 106 is:
echo It is advised you exit from su mode first by typing 'exit'
and 126 is the end of the file...
Bascially I don't know why my echos suddenly disappear.
I have put the script behind an LJ cut tag (I hope)
echo Starting Printer configuration
#linux-config &
echo Starting MSN messenger
#/home/george/apps/msn/amsn &
echo Loading Webcam Module....
#su - root --command=""
insmod /home/george/webcam/mod_quickcam.o
echo George's Sharp Zaurus SL5000/SL5500 Initialisation Script v1.0
echo You MUST be root or su to use this script.
echo Loading USBDNET
echo Don't worry too much about WARNING messages!
echo Or that the module 'already exists'
insmod usbdnet | grep -v "WARNING"
echo Initializing Sharp Zaurus!
#echo Please take the Zaurus in and out of the cradle and press the sync button!
for count in 1 2 3 4 5 6 7 8 9 10
do
for x in - \\ \| /;
do printf "%c\b" $x;
sleep 0.25;
done;
done;
echo Attempting to add a route to your Zaurus!
echo If you see an error message wait until the script has finished
echo and take the Zaurus out of it's cradle then replace it.
echo If you see no error messages, then the process has completed successfully!
echo If you are running this for the second time, you might get a message:
echo SIOCADDRT: File exists
echo It is safe to ignore this
route add -host 192.168.129.201 usb0
echo Please Wait!
for count in 1 2 3 4 5 6 7 8 9 10
do
for x in - \\ \| /;
do printf "%c\b" $x;
sleep 0.25;
done;
done;
echo Attempting to Bring the interface to the Zaurus up!
ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
echo Please Wait!
for count in 1 2 3 4 5 6
do
for x in - \\ \| /;
do printf "%c\b" $x;
sleep 0.25;
done;
done;
echo Trying to ping your Zaurus!
echo If you see a ping reply then configuration was successful!
ping 192.168.129.201 -c 2
echo You can now start Qtopia
echo It is advised you exit from su mode first by typing 'exit'
echo Script Finished
echo Do you wish to start webcam? Y/N?
read I
if [ $I = "Y" ]; then
echo Starting Webcam...
killall webcam
webcam /home/george/webcam/webcam.conf
webcam /home/george/webcam/webcam.conf
fi
if [ $I = "N" ]; then
echo Webcam NOT started...
fi
thanks for your help
Starting Printer configuration <--good
Starting MSN messenger <--good
Loading Webcam Module.... <--yes fine
start.sh: line 16: insmod: command not found <--okay not root
Georges Sharp Zaurus SL5000/SL5500 Initialisation Script v1.0 <--good
echo You MUST be root or su to use this script. <---urgh
echo Loading USBDNET <--what is happening here
echo Dont worry too much about WARNING messages!
Or that the module already exists
start.sh: line 26: insmod: command not found
Initializing Sharp Zaurus!
Attempting to add a route to your Zaurus!
If you see an error message wait until the script has finished
start.sh: line 106: unexpected EOF while looking for matching `''
start.sh: line 126: syntax error: unexpected end of file <--ahhhh!!
If you paste this into vi, you will see that line 106 is:
echo It is advised you exit from su mode first by typing 'exit'
and 126 is the end of the file...
Bascially I don't know why my echos suddenly disappear.
I have put the script behind an LJ cut tag (I hope)
echo Starting Printer configuration
#linux-config &
echo Starting MSN messenger
#/home/george/apps/msn/amsn &
echo Loading Webcam Module....
#su - root --command=""
insmod /home/george/webcam/mod_quickcam.o
echo George's Sharp Zaurus SL5000/SL5500 Initialisation Script v1.0
echo You MUST be root or su to use this script.
echo Loading USBDNET
echo Don't worry too much about WARNING messages!
echo Or that the module 'already exists'
insmod usbdnet | grep -v "WARNING"
echo Initializing Sharp Zaurus!
#echo Please take the Zaurus in and out of the cradle and press the sync button!
for count in 1 2 3 4 5 6 7 8 9 10
do
for x in - \\ \| /;
do printf "%c\b" $x;
sleep 0.25;
done;
done;
echo Attempting to add a route to your Zaurus!
echo If you see an error message wait until the script has finished
echo and take the Zaurus out of it's cradle then replace it.
echo If you see no error messages, then the process has completed successfully!
echo If you are running this for the second time, you might get a message:
echo SIOCADDRT: File exists
echo It is safe to ignore this
route add -host 192.168.129.201 usb0
echo Please Wait!
for count in 1 2 3 4 5 6 7 8 9 10
do
for x in - \\ \| /;
do printf "%c\b" $x;
sleep 0.25;
done;
done;
echo Attempting to Bring the interface to the Zaurus up!
ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
echo Please Wait!
for count in 1 2 3 4 5 6
do
for x in - \\ \| /;
do printf "%c\b" $x;
sleep 0.25;
done;
done;
echo Trying to ping your Zaurus!
echo If you see a ping reply then configuration was successful!
ping 192.168.129.201 -c 2
echo You can now start Qtopia
echo It is advised you exit from su mode first by typing 'exit'
echo Script Finished
echo Do you wish to start webcam? Y/N?
read I
if [ $I = "Y" ]; then
echo Starting Webcam...
killall webcam
webcam /home/george/webcam/webcam.conf
webcam /home/george/webcam/webcam.conf
fi
if [ $I = "N" ]; then
echo Webcam NOT started...
fi
thanks for your help
