sys/class/gpio/gpio2/value/
#!/bin/shwhile [ "1" = "1" ]doa=1 # Fixed valueb=0 # Fixed value - 1page=$(cat /sys/class/gpio/gpio2/value)echo "Temperature: $page"if [ $page -ge $a ]thencurl -u $API: https://api.pushbullet.com/v2/pushes -d type=note -d title="Zavlaha povolena je "$page"°C" -d body="$MSG"echo "1"elif [ $page -le $b ]thenfisleep 30done
old=`cat ./testfile`;while inotifywait -e MODIFY ./testfile 2>/dev/null >/dev/null ; do now=`cat ./testfile`; if [ "$now" != "$old" ]; then echo "File content changed"; fi; old=$now;done
#!/bin/shOLD_VALUE=$(cat /cesta/ke/sledovanymu/souboru)NEW_VALUE=$OLD_VALUEwhile true; do sleep 1 NEW_VALUE=$(cat /cesta/ke/sledovanymu/souboru) if [ $OLD_VALUE != $NEW_VALUE ]; then echo Sem patri tvoje akce OLD_VALUE=$NEW_VALUE fidone
#!/bin/shOLD_VALUE=$(cat value)NEW_VALUE=$OLD_VALUEwhile true; do sleep 1 NEW_VALUE=$(cat value) if [ $OLD_VALUE != $NEW_VALUE ]; then OLD_VALUE=$NEW_VALUE case $NEW_VALUE in 0) echo Hodnota se zmenila na 0 ;; 1) echo Hodnota se zmenila na 1 ;; *) echo Neplatny stav ;; esac fidone