22 lines
594 B
Bash
22 lines
594 B
Bash
|
|
#!/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
|