#PEAR_Config 0.9 a:12:{s:7:"php_dir";s:67:"//pear/php";s:8:"data_dir";s:68:"//pear/data";s:7:"www_dir";s:67:"//pear/www";s:7:"cfg_dir";s:67:"//pear/cfg";s:7:"ext_dir";s:67:"//pear/ext";s:7:"doc_dir";s:68:"//pear/docs";s:8:"test_dir";s:69:"//pear/tests";s:9:"cache_dir";s:69:"//pear/cache";s:12:"download_dir";s:72:"//pear/download";s:8:"temp_dir";s:68:"//pear/temp";s:7:"bin_dir";s:63:"//pear";s:7:"man_dir";s:67:"//pear/man";}
|
Server IP : 99.192.176.69 / Your IP : 216.73.216.4 Web Server : Apache System : Linux platinumpuzzy2.eosdns.net 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 User : bbwcamhouse ( 1000) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0555) : /../../etc/ssl/../python/../python/../python/../python/../python/../../sbin/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
#!/usr/bin/bash
#
# Polls PJL options from local or network printers
#
#
# Till Kamppeter (till.kamppeter@gmx.net)
#
# Copyright 2001 Till Kamppeter
#
# This software may be freely redistributed under the terms of the GNU
# General Public License (http://www.gnu.org/).
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Modifed by Patrick Powell <papowell at astart.com>
# - error messages, fixed problem with netcat
# - increased timeout, added a job end to sequence
# as this was needed by a couple of printers
NC=/usr/bin/nc
CAT=/usr/bin/cat
PRINTF=/usr/bin/printf
PERL=/usr/bin/perl
usage(){
cat <<EOF ;
usage: foomatic-getpjloptions <device>
foomatic-getpjloptions <hostname> <port>
<device>: Device where a local printer is connected to
examples: /dev/lp0, /dev/usb/lp0
Have your parallel port in EPP/bi-directional mode
(see your BIOS settings).
<hostname>: Host name or IP of a network printer (HP JetDirect,
Socket, ...)
<port>: Port of your network printer.
echo
Uni-directional protocols as remote LPD are not supported.
The option list is sent to standard output.
EOF
exit 1;
}
case "$1" in
-* ) usage;;
"" ) usage;;
esac
# We have at least one argument, so do the work
(
# PJL commands to request the printer information
$PRINTF "\033%%-12345X"
$PRINTF "@PJL\r\n"
$PRINTF "@PJL INFO VARIABLES\r\n"
$PRINTF "@PJL INFO ID\r\n"
$PRINTF "@PJL INFO CONFIG\r\n"
$PRINTF "\033%%-12345X"
) | if [ ${2:-X} != X ]; then
# We have two arguments, do ethernet printer request
# Poll the printer's answer and filter out the newpage characters
${NC} -w 3 ${1} ${2} 2>/dev/null | ${PERL} -p -e "s/\014//"
else
# We have one argument, do local printer request
# Send commands to printer port
${CAT} > ${1}
# Wait ten seconds for the printer to process the request
sleep 10
# Poll the printer's answer and filter out the newpage and CR characters
${CAT} < ${1} | ${PERL} -p -e "s/[\015\014]//"
fi