Files
mastering-unix-ss/chapter25/print_UP_HP-UX.ksh
Fabio Scotto di Santolo 4cc88d2f6e initial commit
2020-07-28 19:28:25 +02:00

31 lines
647 B
Bash
Executable File

#!/bin/ksh
#
# SCRIPT: print_UP_HP-UX.ksh
#
# AUTHOR: Randy Michael
# DATE: 03/14/2007
# REV: 1.1.P
#
# PLATFORM: HP-UX Only
#
# PURPOSE: This script is used to enable printing and queuing separately
# on each print queue on an HP-UX system.
#
# REV LIST:
#
# set -x # Uncomment to debug this script
# set -n # Uncomment to check syntax without any execution
lpstat | grep Warning: | while read LINE
do
if (echo $LINE | grep 'is down') > /dev/null
then
enable $(echo $LINE | awk '{print $3}')
fi
if (echo $LINE | grep 'queue is turned off') >/dev/null
then
accept $(echo $LINE | awk '{print $3}')
fi
done