[cups] Sending mail from a CentOS7 virtual machine to Fuji Xerox ApeosPort-IV C4475 problem revisted

マスターズ・イアン ian at ncsa.jp
Fri Oct 12 00:50:37 PDT 2018


> How are you at reading shell scripts? 

Not very good at all really.

> Maybe it needs a 6th argument to start with (not sure). This is the code you want to test right?

Well I'm wondering why piping my test message through the filters is not changing the message at all ...

> sed -e '/@PJL COMMENT Version:4.00/ a\
> @PJL SET JOBATTR='\"${FX_MACHINE_NAME}\"'\
> @PJL SET JOBATTR='\"${FX_AUTH_ID}\"'\
> @PJL SET JOBATTR='\"${FX_LOCAL_USER}\"'\
> @PJL SET JOBATTR='\"${FX_CARD_NUMBER}\" $INPUT

My /usr/lib/cups/filter/fxauth now looks like this:

#!/bin/bash

[ -n "$6" ] && exec <"$6"
# input is regular file
cleanup() { EXIT_CODE=$? ; rm -f $INPUT &>/dev/null ; exit $EXIT_CODE ; }
trap 'cleanup' 0 1 2 3 15
  
MY_NAME=${0##*/}
INPUT=$( mktemp /var/spool/cups/tmp/root.XXXXXX ) || exit 1
cat - >$INPUT
  
# prefilter for all printjobs arriving on linux, since authentication is not optional
  
#source /etc/cups/ppd/${PRINTER}.fx
source /etc/cups/ppd/11F1.fx
  
sed -e '/@PJL COMMENT Version:4.00/ a\
@PJL SET JOBATTR="@CNAM=P10316-VM"
@PJL SET JOBATTR="@DAID="
@PJL SET JOBATTR="@JOAU=3496"
@PJL SET JOBATTR="@LUNA=3496" $INPUT

exit $?

I'm sure that's probably horrendously incorrect.

The errors I get are:
/usr/lib/cups/filter/fxauth.test: 行 17: 一致する `'' を探索中に予期しないファイル終了 (EOF) です
/usr/lib/cups/filter/fxauth.test: 行 24: 構文エラー: 予期しないファイル終了 (EOF) です

or in English, somnething like:

/usr/lib/cups/filter/fxauth.test: Line 17: Unexpected end of file (EOF) while searching matching '' '
/usr/lib/cups/filter/fxauth.test: line 24: syntax error: unexpected end of file (EOF)

I think I'm just about ready to give up.

I can't understand why my results are so different from yours (except you were using an earlier version of CentOS if I remember rightly)

I really appreciate all the help you've given me on this but it's starting to feel like I'm getting further and further away from the solution ...

ian


More information about the cups mailing list