diff --git a/faxreport.sh b/faxreport.sh index 04940cb..e4d4309 100755 --- a/faxreport.sh +++ b/faxreport.sh @@ -51,8 +51,22 @@ OUTFILE="$DATE-$ID-report.pdf" if [ -z $FILE ] then echo "Fax seems not to be sent successfully (yet). No report available" + read -p "Delete id from history anyways? (y/n) " DIN + if [[ $DF = true && $DIN =~ [yYjJ] ]] + then + echo "$(grep -v "^$ID$" $BASEPATH/.fax_history)" > $BASEPATH/.fax_history + fi exit 1 -else +fi +if [ $PF = false ] +then echo "Speichere Report in $OUTFILE" curl $FILE --output $OUTFILE -s +else + echo "Schicke Report an Drucker" + curl $FILE -s --output - | ln +fi +if [ $DF = true ] +then + grep -v $ID $BASEPATH/.fax_history > $BASEPATH/.fax_history fi