Files
rayhunter/dist/scripts/rayhunter_daemon
Markus Unterwaditzer c285e2ca08 Various fixes for TP-Link
* explicitly mount the SD card to improve reliability
* do not crash when the SD card is already mounted
* address some review feedback
2025-05-16 11:48:23 -07:00

30 lines
719 B
Bash

#! /bin/sh
set -e
case "$1" in
start)
echo -n "Starting rayhunter: "
# Below line may be replaced by the installer with device-specific startup commands, such as mounting the SD card.
#RAYHUNTER-PRESTART
start-stop-daemon -S -b --make-pidfile --pidfile /tmp/rayhunter.pid \
--startas /bin/sh -- -c "RUST_LOG=info exec /data/rayhunter/rayhunter-daemon /data/rayhunter/config.toml > /data/rayhunter/rayhunter.log 2>&1"
echo "done"
;;
stop)
echo -n "Stopping rayhunter: "
start-stop-daemon -K -p /tmp/rayhunter.pid
echo "done"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage rayhunter_daemon { start | stop | restart }" >&2
exit 1
;;
esac
exit 0