-
Archiwa
-
Meta
Miesięczne archiwum: Sierpień 2013
Antistorm.eu i automatyczne wyłączanie serwera
Skrypt wyłączający serwer po zgłoszeniu burzy w regionie przez antistorm.eu
1 2 3 4 5 6 7 8 9 10 11 |
#/bin/sh LOG_FILE="/var/log/storm.log" BLACH=<code>/usr/bin/curl -s "http://antistorm.eu/webservice.php?id=17" | /usr/bin/grep -e '"s"' | /usr/bin/sed -e 's/.*s": \(.*\)}$/\1/'</code> CZWA=<code>/usr/bin/curl -s "http://antistorm.eu/webservice.php?id=56" | /usr/bin/grep -e '"s"' | /usr/bin/sed -e 's/.*s": \(.*\)}$/\1/'</code> if [ $BLACH -eq 1 -o $CZWA -eq 1 ]; then echo "<code>date</code> - Shutting down with values: BLACH $BLACH, CZWA $CZWA" >> $LOG_FILE /usr/bin/poweroff fi |
Opublikowano Skrypty, kody źródłowe
Skomentuj