From b2fef707c32ad406802e5918a824efd0cdfdf12f Mon Sep 17 00:00:00 2001 From: Filip Date: Fri, 26 Dec 2025 09:54:04 +0100 Subject: [PATCH] Add mediamtx.sh --- mediamtx.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mediamtx.sh diff --git a/mediamtx.sh b/mediamtx.sh new file mode 100644 index 0000000..4784b8b --- /dev/null +++ b/mediamtx.sh @@ -0,0 +1,22 @@ +#!/bin/bash +useradd -m mediamtx +cd /home/mediamtx +su -c 'wget https://github.com/bluenviron/mediamtx/releases/download/v1.15.5/mediamtx_v1.15.5_linux_amd64.tar.gz' mediamtx +su -c 'tar xf mediamtx_v1.15.5_linux_amd64.tar.gz' mediamtx +su -c 'rm mediamtx_v1.15.5_linux_amd64.tar.gz' mediamtx +echo '[Unit] +Description=Media MTX +After=network.target + +[Service] +Type=simple +ExecStart=/home/mediamtx/mediamtx +WorkingDirectory=/home/mediamtx +User=mediamtx +Restart=always + +[Install] +WantedBy=multi-user.target' > "/etc/systemd/system/mediamtx.service" + +systemctl enable mediamtx +systemctl start mediamtx \ No newline at end of file