Hotplug SCSI scanner or How to write to /proc/scsi/scsi from within a shell script.
I am trying to write the folowing code into a shell script, to enable me to hotplug a scsi scanner, without giving out the root pasword to the users. (Wife and Child)
Code as follows
# A small script to automatically mount the scanner and start xsane.
typeset -i num
num=`cat /proc/scsi/scsi | grep Scanner | wc -l`
if [ $num -eq 1 ]; then
echo "scsi add-single-device 1 0 6 0" > /proc/scsi/scsi
The script runs as root or suid, but when running as suid it will not write to /proc/scsi/scsi permission not granted and I am unable to change the permissions of /proc (for good reason).