Skip to content

Commit 164c3ed

Browse files
authored
Shell script to keep sensor program running after some errors occur
1 parent 6e80097 commit 164c3ed

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

hack_ble.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
trap "echo Exited!; exit;" SIGINT SIGTERM
4+
5+
if [ $EUID -ne 0 ]; then
6+
echo "This script should be run as root." > /dev/stderr
7+
exit 1
8+
fi
9+
10+
while :
11+
do
12+
echo 'Running ble_sensor_mqtt_pub'
13+
date '+%Y%m%d%H%M%S'
14+
echo "Press [CTRL+C] to stop.."
15+
cd /home/pi/atc-govee
16+
/home/pi/atc-govee/ble_sensor_mqtt_pub 0 1 200 500
17+
done
18+
19+

0 commit comments

Comments
 (0)