I need assistance on creating ,deleting printers within a function herwith is what i have
Any assistance will be highly appreciated
Code:
#!/bin/ksh
BIN=/usr/lbin
LOCAL_FILE=`$BIN/lpstat -v >> sun5-printers.txt
REMOTE_FILE=`rsh sun8 /usr/lbin/lpstat -v >> sun8-printers.txt
awk 'BEGIN {while ( getline < "sun5-printers.txt") {arr[$0]++ }}{ if (!($0
in arr ) ) {print} }' sun8-printers.txt
#Amend,create or delete Printer
prExists=$?
function printerExists()
{
prName=" "
prAddress=" "
prLocation=" "
prdescrip=" "
prfilter=" "
prport=" "
prdriver=" "
if [ $prExists -eq 1 ]; then
echo "\n\t Printer already exists. "
else
echo
$BIN/lpadmin -x $Prname
echo "\n\t Deleting printer $Prname !!!"
fi
# Add Printer Command
lpadmin -p "${prName}" -E -D "${prDescript}" -L "${prLocation}" -i /u1/cups/mac/"$prFilter_filter -v \
"$Prdriver"://"${prAddress}":"Prport"
fi
Any assistance will be highly appreciated