|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/printconf/util/ |
Upload File : |
#!/bin/bash
# Direct-to-printer (old HP Jetdirect style printers) filter
# to integrate with printconf.
# Bash implementation Copyright (C) 2002 Tim Waugh <twaugh@redhat.com>
. script.cfg
# if the port isn't set, use the default of 9100
: ${port:=9100}
# Maximum number of times to retry connection
max_retries=60 # at one second each, one minute.
retry_count=0
while [ $retry_count -lt $max_retries ]
do
(cat >&3; while read <&3 -sn1 -t1; do :; done) \
3<>/dev/tcp/$printer_ip/$port && break
retry_count=$(($retry_count + 1))
sleep 1
done