diff --git a/noten.sh b/noten.sh index 96c2aa6..bc32338 100755 --- a/noten.sh +++ b/noten.sh @@ -32,6 +32,11 @@ AJAXDATA=$(curl -s -b $COOKIES -c $COOKIES -d "User=$USERNAME&Session=$SESSION&L # Finally... cp $FINALFILE $TMPPATH curl -s -b $COOKIES -c $COOKIES -d $AJAXDATA $FU | awk 'f{ if (/<\/tbody>/){printf "%s", buf; f=0; buf=""} else buf = buf $0 ORS}; //{f=1}' | rg -o -e '(.*)' -r '$1' | sudo -u http tee $FINALFILE +# If nothing is returned exit to prevent unwanted mails +if [ $(wc -l < $FINALFILE) -lt 2 ]; then + cp $TMPPATH/noten.html $FINALFILE + exit 1 +fi # If there is a change in the file, send an email D=$(diff $FINALFILE $TMPPATH/noten.html) if [ "$D" != "" ]; then