Rewrite OG Buttons
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user