Komentare hinzugefügt
This commit is contained in:
parent
18d0aa878a
commit
8efaf7df01
1 changed files with 5 additions and 0 deletions
5
push.sh
5
push.sh
|
@ -4,13 +4,17 @@ DEV='/dev/ttyUSB0'
|
|||
DIR='push.d'
|
||||
stty -F "$DEV" 9600 -brkint -icrnl -imaxbel -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
|
||||
|
||||
# Warte bis Device $DEV vorhanden ist
|
||||
while [ ! -c "$DEV" ]; then
|
||||
sleep 2
|
||||
done
|
||||
# sende beliebiges Zeichen an $DEV
|
||||
echo '?' >> "$DEV" &
|
||||
|
||||
while true; do
|
||||
# wenn $DEV vorhanden
|
||||
if [ -c "$DEV" ]; then
|
||||
# dann lese zustand
|
||||
read -r state < "$DEV"
|
||||
case "$state" in
|
||||
ON|HALF|OFF)
|
||||
|
@ -18,6 +22,7 @@ while true; do
|
|||
;;
|
||||
esac
|
||||
else
|
||||
# sonst warte
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
|
Reference in a new issue