SIM800C/etc/init.d/t3hs_sim800.sh
2025-06-08 13:33:31 +02:00

40 lines
423 B
Bash
Executable File

#!/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