LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-30-2004, 01:21 PM   #1
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
Hotplug SCSI scanner or How to write to /proc/scsi/scsi from within a shell script.


Hi

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

#!/bin/bash
#
# 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
xsane
else
xsane
fi

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).
 
Old 08-30-2004, 02:28 PM   #2
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
I've found a solution Thanks anyway.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scanner Umax 2200 (USB,SCSI) with AHA2940U scsi card problem in Suse 9.2 Pro nathanv117 SUSE / openSUSE 5 02-22-2005 02:06 PM
SCSI Scanner Hotplug Question failure_man Linux - Hardware 1 10-18-2004 12:17 PM
Error editing /proc/scsi scsi file Thaidog Linux - Newbie 2 08-26-2004 08:19 AM
Some info about '/proc/scsi/scsi' and '/dev' C.Loko Slackware 4 11-27-2003 12:30 PM
allow non root users add devices to /proc/scsi/scsi ? ewto Linux - Newbie 5 10-14-2003 11:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration