Bash Scripting
Kind of you to have pity on me here...I am trying to make a simple bash script:
echo Loading Sharp Zaurus Module...
insmod usbdnet
echo Initializiing Sharp Zaurus...
echo Make Sure you have it plugged in...
route add -host 192.168.129.201 usb0
ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
read INPUT
if $INPUT ="Y"; then
echo Starting Webcam...
killall webcam
webcam /home/george/webcam/webcam.conf
webcam /home/george/webcam/webcam.conf
fi
if $INPUT ="N"; then
echo Webcam NOT started...
fi
1)Why doesn't the second bit wen checking for user input work :-(
2)Also is it possible to output in different colours?
3)Is it possible to surpress WARNING: messages when doing an insmod (just makes the script look neater- usbdnet returns some warning which doesn't affect it )
4)In the first part of my script:
I would like it to check if usb0 exists before continuing i.e. if the sharp zaurus isn't switched on then the commands will return errors something like:
if usb0 exists then... do the rest of the stuff
if it doesn't exist then .. echo Sharp Zaurus Not Plugged In!
5) finally the insmod commands need to be done as root, so can you get the script to prompt you for the root password?
thanks!!
echo Loading Sharp Zaurus Module...
insmod usbdnet
echo Initializiing Sharp Zaurus...
echo Make Sure you have it plugged in...
route add -host 192.168.129.201 usb0
ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
read INPUT
if $INPUT ="Y"; then
echo Starting Webcam...
killall webcam
webcam /home/george/webcam/webcam.conf
webcam /home/george/webcam/webcam.conf
fi
if $INPUT ="N"; then
echo Webcam NOT started...
fi
1)Why doesn't the second bit wen checking for user input work :-(
2)Also is it possible to output in different colours?
3)Is it possible to surpress WARNING: messages when doing an insmod (just makes the script look neater- usbdnet returns some warning which doesn't affect it )
4)In the first part of my script:
I would like it to check if usb0 exists before continuing i.e. if the sharp zaurus isn't switched on then the commands will return errors something like:
if usb0 exists then... do the rest of the stuff
if it doesn't exist then .. echo Sharp Zaurus Not Plugged In!
5) finally the insmod commands need to be done as root, so can you get the script to prompt you for the root password?
thanks!!
