From 2f896fac69ba5c10c8d6caf9f9748a762794668f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20Podgor=C5=A1e?= Date: Tue, 6 Jun 2023 16:33:42 +0200 Subject: [PATCH] mjpeg relay skripte --- mjpeg-relay.sh | 5 +++++ systemd/mjpeg-relay.service | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 mjpeg-relay.sh diff --git a/mjpeg-relay.sh b/mjpeg-relay.sh new file mode 100755 index 0000000..32af777 --- /dev/null +++ b/mjpeg-relay.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd $SCRIPT_DIR/mjpeg-relay +python2 relay.py http://localhost:8989/stream diff --git a/systemd/mjpeg-relay.service b/systemd/mjpeg-relay.service index 2317e05..8627161 100644 --- a/systemd/mjpeg-relay.service +++ b/systemd/mjpeg-relay.service @@ -7,9 +7,11 @@ After=network.target User=g1smo RemainAfterExit=yes WorkingDirectory=/home/g1smo/galerija-bot/mjpeg-relay -ExecStart=python2 relay.py http://localhost:8989/stream +ExecStart=/usr/bin/screen -DmS mjpeg-relay /home/g1smo/galerija-bot/mjpeg-relay.sh RestartSec=5 -Restart=always +#Restart=always +Restart=on-failure +Type=forking [Install] WantedBy=multi-user.target