diff --git a/get_invoice.sh b/get_invoice.sh index 7ed3239..8412d16 100755 --- a/get_invoice.sh +++ b/get_invoice.sh @@ -10,10 +10,11 @@ gpio write ${LED1} ${LED_ON} exec 9< $0 flock -n 9 || exit 1 +sudo rm -f ${PROGDIR}/invoice.png ${PROGDIR}/invoice.txt + DESC=`echo $2 | sed 's/"//g'` ${PTARMDIR}/ptarmcli -i $1 --description="${DESC}" --no-rfield | jq -r '.result.bolt11' | tr -d '\n' > ${PROGDIR}/invoice.txt qrencode -s 2 -o ${PROGDIR}/invoice.png `cat ${PROGDIR}/invoice.txt` python3 ${EPAPERDIR}/epaper.py ${PROGDIR}/invoice.png gpio write ${LED1} ${LED_OFF} -