HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] faxsend return value problem



WARNING:  The following data has NOT been sanitized, to ensure
          that the signature remains intact, if valid.  Please
          be careful if you open any enclosed attachments.

WARNING:  The following data has NOT been sanitized, to ensure
          that the signature remains intact, if valid.  Please
          be careful if you open any enclosed attachments.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

And Here is my wrapper script.......


#################################################################
#! /bin/bash
# by Diego Ercolani (c) 2002
# Diego.Ercolani@yacme.com
#
( echo -n `date`; echo -n "$0 :"; echo "Parameters $*";
  echo "/var/spool/hylafax/docq:";
  ls /var/spool/hylafax/docq | sed 's/^/        /';
  echo "/var/spool/hylafax/sendq:";
  ls /var/spool/hylafax/sendq | sed 's/^/        /'
) >>/tmp/hyladiego.log
echo "$*" | xargs $(if [ `echo $0 | grep -c page` -eq 0 ]; then echo 
"/usr/sbin/faxsend";
                                                           else echo 
"/usr/sbin/pagesend";
                    fi)
RETVAL=$?
{
  echo -n "RETVAL: $RETVAL status - "
  case $RETVAL in
  0) echo "Send Retry, retry job"
     ;;
  1) echo "Send Failed, job finito senza successo"
     ;;
  2|123)
     # WORK AROUND - by diego
     if [ ! -f "$3" ]; then
        echo "Requeued Required becasuse of Tiramento di Culo"
        RETVAL=0;
     else
        echo "$3:"
        cat $3
        echo "-----"
        STATUS=$(cat $3 | awk '/^status/ { FS=":"; print $2; }')
        echo "STATUS: \"$STATUS\""
        case "$STATUS" in
          "")
            echo "Job Done (as supposed by Diego Workaround!)"
#           faxsave
          ;;
          *)
            echo "Requeue required by Diego Utility"
            export RETVAL=0; # Force requeue
         esac
     fi
     ;;
  3) echo "Send Reformat, job da rifare riformattando"
     ;;
  *) echo "Codice Sconosciuto ..... verificare"
     export RETVAL=1
  esac
  echo "------------------------------------------------------------------"
} >> /tmp/hyladiego.log
exit $RETVAL
##################################################################
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+LFHk4ytO7itWWCwRAlYHAJ9hnSZjh5yeeM+sKSV2+OvbzKMJ3gCfbswK
YTAqR+0+0/ABGZUpiVVy8X8=
=Zzsw
-----END PGP SIGNATURE-----


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*




Project hosted by iFAX Solutions