fix: Prevent mails if there was no conection to primuss
This commit is contained in:
		
							parent
							
								
									861f26ecea
								
							
						
					
					
						commit
						8667d8d5b1
					
				
							
								
								
									
										5
									
								
								noten.sh
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								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}; /<tbody>/{f=1}' | rg -o -e '<b>(.*)</b>' -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 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 toerd@480
						toerd@480