You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
490 B
Bash
22 lines
490 B
Bash
#!/bin/bash
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
echo $SCRIPT_DIR
|
|
|
|
sudo tee /etc/systemd/system/game-runner.service <<EOF
|
|
[Unit]
|
|
Description=Game runner http server. Listens on http://192.168.1.140:8111/?game=kodi and runs a game
|
|
After=network.target
|
|
|
|
[Service]
|
|
ExecStart=/usr/bin/python3 $SCRIPT_DIR/game-runner.py
|
|
WorkingDirectory=/home/kuba/
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
User=kuba
|
|
Environment=PYTHONUNBUFFERED=1
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|