#!/usr/bin/sh #(c) Copyright 1993 ~ 1995 Hewlett-Packard Company. All Rights Reserved. # #@(#) $Header: /users/hpnp/odyssey/repository/sh/net_genericprinter.psh,v 1.55 1999/11/25 15:52:13 hpnp Exp $ #-------------------------------------------------------------------------- # USER CAUTION: Starting this version, there are other programs depending on # the statements planted here for various purposes. Your changes in this # file may render those information inaccurate. # # To customerize this script, edit the following functions: # Init_variables - to initialize new variables # Paring_Options - to parse the options you create, and set the variables # Output_PCL_Optins and/or Output_PS_Options # - to output the PCL/PS commands according the variable # settings #-------------------------------------------------------------------------- #[ For WJA use #version E.10.05 #supports Generic printer # by Devu 1 oct 1999] # hpnpl sets the following: OS, PERSONALTY, PRINTMODEL, TEOJ, and BANNER HPNP=/opt/hpnp BIN=/usr/bin HPNPS=$HPNP/bin/hpnps # [ Modified by Suresha on 26th Sep 99 to support JPIU HPNP=/opt/hpnpl HPNPS=$HPNP/bin/hpnps # end of change by suresha DUPPRINT="def" BANTRAY="def" #BANNER TRAY PSLEVEL="1" # CHANGE POSTSCRIPT LEVEL PERSONALTY="AUTO" # CHANGE LANGUAGE BAUDRATE="9600" PRINTMODEL="genericprinter" # CHANGE PRINTER MODEL TEOJ="" # CHANGE TRUE END OF JOB BANNER="yes" # CHANGE BANNER PAGE PRINTING MPAGE=$HPNP/bin/mpage #Added by Ramki on 14th Oct 98 for PSNUP SPACECHAR="_-" OS="UNKNOWN" if [ "$OS" = "UNKNOWN" ] then OS=`uname` fi TMP=/tmp ID=/usr/bin/id CUT=/usr/bin/cut AWK=/usr/bin/awk MKDIR=/usr/bin/mkdir USERNAME=`$ID | $CUT -f1 -d" " | $CUT -f2 -d"(" | $CUT -f1 -d")"` # get user name if [ $USERNAME = "root" -o $USERNAME = "lp" ] then TMP=$HPNP/tmp else /usr/bin/sun > /dev/null 2>&1 if [ $? -eq 0 ] then # [ Modified by Amit Raval to fix the defect#57434 on 20th Apr. 1999 # HOME=`$AWK 'BEGIN { FS=":" } # {if ( $1 == UNAME) print $6 ; }' UNAME=$USERNAME /etc/passwd` # get home dir. from /etc/passwd JAHOME=`$AWK 'BEGIN { FS=":" } {if ( $1 == UNAME) { print $6 ; exit } }' UNAME=$USERNAME /etc/passwd` # get home dir. from /etc/passwd # ] else # [ Modified by Amit Raval to fix the defect#57434 on 20th Apr. 1999 # HOME=`$AWK -v UNAME=$USERNAME 'BEGIN { FS=":" } # {if ( $1 == UNAME) print $6 ; }' /etc/passwd` # get home dir. from /etc/passwd JAHOME=`$AWK -v UNAME=$USERNAME 'BEGIN { FS=":" } {if ( $1 == UNAME) { print $6 ; exit } }' /etc/passwd` # get home dir. from /etc/passwd # ] fi if [ -z "$JAHOME" ] # Handle the NIS issue then JAHOME=$HOME # Assign the env veriable HOME if JAHOME is null. fi # [Modified by Kumaresan for JPIU on 26th Sept '99. if [ ! -d $JAHOME/.jpiu ] then $MKDIR $JAHOME/.jpiu > /dev/null 2>&1 if [ $? -eq 0 ] then TMP=$JAHOME/.jpiu fi else TMP=$JAHOME/.jpiu fi fi # ] case "$OS" in HP-UX) patternlist="-e shar -e object -e executable -e archive -e library -e compressed" GREP="$BIN/grep $patternlist" esc="" PR="pr -F" log="/var/adm/lp/log" ;; solaris | SOLARIS | SunOS) OS="SOLARIS" PR="pr -f" if [ -w "/var/spool/lp/logs/lpsched" ] then log="/var/spool/lp/logs/lpsched" else log=/dev/null fi ;; esac # -------- Part I Functions ----------------- # print the option listing with -ooptions while submitting a job all_options() { echo "\033&k2G\033&l0O\c" # always in portrait mode echo "\033&k2G\033(s3B\t\t\033&d0D\c" echo "Options for Model Script net_genericprinter\n" echo "\033&d@SYNOPSIS:\033(s0B\c" echo "\tlp -o