How can I give a user the ability to enable printers that "go down". I do not want them signing on as su. I've tried various combinations of groups and roles to no avail.
Assign the users to the printq group.
I am assuming the DOWN message is from queue status and you only have one device assigned to each queue.
Use enq -P LAS02 -U
Substitute your queue name for LAS02
You can verify the queue is up quickly with
enq -s -P LAS02
Assume that there r 3 depts. and in for each dept. there r 3 ques. The undermentioend script will give user option to choose between depts. and printer ques. The user can enable his/her desired que through this script without wntering the command. Change the print ques according to ur requirement.
while true
do
tput clear
echo "^[[4m Printer Status ^[[0m"
tput cud1
echo " Department A = 1 "
echo " Department B = 2 "
echo " Department C = 3 "
echo " Exit = 4 "
tput cud1
echo "Enter your choice : \c"
read opt
case $opt in
1) lpstat -ad1a,d1b,d1c | grep -v : | pg ;;
2) lpstat -ad2a,d2b,d2c | grep -v : | pg ;;
3) lpstat -ad3a,d3b,d3c | grep -v : | pg ;;
4) break ;;
esac
echo "Do you want to enable any que [Y/N] : \c"
read ans1
if [ $ans1 = "Y" -o $ans1 = "y" ]
then
tput cud1
echo "Enter que name to activate : \c"
read quenm
quenm=`echo $quenm | tr "A-Z" "a-z"`
if [ $opt = "1" ]
then
case $quenm in
d1a|d1b|d1c) disable d1a d1b d1c
enable $quenm ;;
*) echo "^[[5mInvalid que name^[[0m" ;;
esac
else
if [ $opt = "2" ]
then
case $quenm in
d2a|d2b|d2c) disable d2a d2b d2c
enable $quenm ;;
*) echo "^[[5mInvalid que name^[[0m" ;;
esac
else
if [ $opt = "3" ]
then
case $quenm in
d3a|d3b|d3c) disable d3a d3b d3c
enable $quenm ;;
*) echo "^[[5mInvalid que name^[[0m" ;;
esac
fi
fi
fi
fi
done
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.