Rewrite OG Buttons

This commit is contained in:
T
2025-09-11 15:36:04 +02:00
parent 4bbb323f30
commit fe3d3967a8
4 changed files with 257 additions and 167 deletions

View File

@@ -3,13 +3,25 @@
FILE=/etc/systemd/system/buttond.service
cat > $FILE << EOF
button=$(realpath button.py)
if [[ ! -f $button ]]; then
echo button.py not found
exit 1
fi
vpython=$(realpath venv/)/bin/python
if [[ ! -e $vpython ]]; then
echo venv not found
exit 1
fi
cat > "$FILE" << EOF
[Unit]
Description = buttonctl
[Service]
Type = simple
ExecStart = /usr/bin/python3 $PWD/button.py
ExecStart = $vpython $button
[Install]
WantedBy=multi-user.target