inverter.sh should run inverter.php indefinitely

daemon.sh should do so, keeping bluetooth connection alive
This commit is contained in:
2012-11-27 09:29:57 +01:00
parent 9c9fce8383
commit 17de1dca8a
2 changed files with 23 additions and 0 deletions

16
opt/inverter/daemon.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
cd /opt/inverter/
while :
do
service bluetooth restart
sleep 10
hcitool scan
sleep 10
bluetooth-agent 1234 00:12:06:15:10:43 &
sleep 10
rfcomm connect 0 00:12:06:15:10:43 1 &
sleep 10
perl inverter.pl
hcitool dc 00:12:06:15:10:43
sleep 10
done

7
opt/inverter/inverter.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
cd /opt/inverter/
while :
do
perl inverter.pl
sleep 10
done