Advertisement
Guest User

AutoRefresher.sh

a guest
Apr 5th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #nohup ./autorefresher.sh > /dev/null 2>&1 &
  4.  
  5. URL="https://profs.info.uaic.ro/~vidrascu/SO/index_news.html"
  6. user="so2018"
  7. password="1+0=10"
  8. mails="adresa at domeniu dot com"
  9.  
  10. while [ 1 ]
  11. do
  12. mv new.html old.html
  13. wget -q --user "$user" --password "$password" "$URL" -O new.html
  14. if [[ -f old.html && -f new.html && $(cat old.html | wc -c) != 0 && $(cat new.html | wc -c) != 0 && $(diff new.html old.html -q | wc -c) != 0 ]]
  15. then
  16. echo "Pagina de la SO a fost modificată. Există posibilitatea să se fi afișat rezultatele!" | mail -s "[AutoRefresh] Pagina de la SO a fost modificată" "$mails"
  17. exit
  18. fi
  19. sleep 60
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement