Description
Below script is used to check the printer, IP status and testing the printer.
Script :
#!/bin/bash
con()
{
if [ $choice -eq 1 ]
then
echo “Give ip address”
read ipad
ping $ipad
echo “WANT TO GO CHOICE 1 OR 2 OR 3 OR 0”
read choice
con $choice
elif [ $choice -eq 2 ]
then
echo “GIVE PRINTER NAME”
read priname
lpstat -p $priname
echo “WANT TO GO CHOICE 1 OR 2 OR 3 OR 0”
read choice
con $choice
elif [ $choice -eq 3 ]
then
echo “GIVE PRINTER NAME”
read priname
lp -d $priname /test
echo “WANT TO GO CHOICE 1 OR 2 OR 3 OR 0”
read choice
con $choice
elif [ $choice -eq 0 ]
then
exit
else
echo “GIVE CRT CHOICE”
fi
}
echo “TO CHECK IP STATUS ENTER 1”
echo “TO CHECK PRINTER STATUS ENTER 2”
echo “TO CHECK TEST PRINT ENTER 3”
echo “TO EXIT ENTER 0”
read choice
con $choice