Add mediamtx.sh
This commit is contained in:
commit
b2fef707c3
22
mediamtx.sh
Normal file
22
mediamtx.sh
Normal file
|
|
@ -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
|
||||||
Loading…
Reference in a new issue