init script added
This commit is contained in:
parent
696b1e7342
commit
29d7dfb147
39
etc/init.d/t3hs_sim800.sh
Executable file
39
etc/init.d/t3hs_sim800.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT_PATH=/usr/bin/t3hs/t3hs_sim800
|
||||
|
||||
case "$1,$2" in
|
||||
start,gpio)
|
||||
"$SCRIPT_PATH" gpio on
|
||||
;;
|
||||
|
||||
start,mqtt)
|
||||
"$SCRIPT_PATH" mqtt on
|
||||
;;
|
||||
|
||||
stop,gpio)
|
||||
"$SCRIPT_PATH" gpio off
|
||||
;;
|
||||
|
||||
stop,mqtt)
|
||||
"$SCRIPT_PATH" mqtt off
|
||||
;;
|
||||
|
||||
restart,gpio)
|
||||
$0 stop gpio
|
||||
sleep 10
|
||||
$0 start gpio
|
||||
;;
|
||||
|
||||
restart,mqtt)
|
||||
$0 stop mqtt
|
||||
sleep 10
|
||||
$0 start mqtt
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart} {gpio|mqtt}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Loading…
Reference in New Issue
Block a user