added launch script, config an systemd unit file.

This commit is contained in:
2026-04-01 10:53:00 +02:00
parent e154348dd7
commit 1e22ebdff5
3 changed files with 120 additions and 0 deletions

15
usr/local/bin/fanctrl Executable file
View File

@@ -0,0 +1,15 @@
#! /bin/bash
cleanup() {
echo "cleanup()"
echo "terminating ${FANCTRL_PID}"
kill -TERM "${FANCTRL_PID}"
}
trap cleanup exit
cd /home/pi/git/fanctrl
exec /home/pi/.local/bin/uv run ./fanctrl.py &
FANCTRL_PID=$!
echo "FANCTRL_PID=${FANCTRL_PID}"
wait "${FANCTRL_PID}"