Initial commit
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
cd /home/pi/
|
||||
rm node.txt
|
||||
touch node.txt
|
||||
gpio mode 15 out
|
||||
gpio mode 8 out
|
||||
gpio write 8 1
|
||||
gpio write 15 0
|
||||
gpio mode 7 out
|
||||
gpio write 7 1
|
||||
sudo node app.js | ts '[%Y-%m-%d %H:%M:%S]' > node.txt &
|
||||
tail -fn0 node.txt | \
|
||||
while read line ; do
|
||||
echo "$line" | grep "12345678-9123-4567-8912-345678912345"
|
||||
if [ $? = 0 ]
|
||||
then
|
||||
# sudo kill -9 $(ps ax | grep "node app.js" | grep -v grep | awk '{print $1}')
|
||||
# gpio write 7 0
|
||||
# gpio write 8 0
|
||||
# sleep 5
|
||||
# gpio write 7 1
|
||||
gpio write 15 1
|
||||
# sudo kill -9 $(ps ax | grep "tail -fn0 node.txt" | grep -v grep | awk '{print $1}')
|
||||
curl http://10.0.1.246/state.xml?extvar0=1
|
||||
sleep 10
|
||||
curl http://10.0.1.246/state.xml?extvar0=0
|
||||
echo "We got a hit" | ts '[%Y-%m-%d %H:%M:%S]' >> hits.txt
|
||||
./checker.sh
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user