#!/bin/bash # apt install wiringpi if test "$2" == ""; then echo $0 PIN WELCHER echo Vorschlag : echo ./checkstrom.sh 14 Haupt \& echo ./checkstrom.sh 15 Reserve \& exit 1 fi gpio export $1 in gpio -g mode $1 up while (true) do gpio -g wfi $1 both v="$(gpio -g read $1)" if test "$v" != "$o"; then if test "$v" == "1"; then ./nachricht.sh "Stromversorgung $2 ausgefallen." else ./nachricht.sh "Stromversorgung $2 wieder da." fi fi sleep 0.3 done