37 lines
1.1 KiB
Bash
Executable File
37 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
WORK_DIR="$(readlink -f $(dirname $0))"
|
|
CERT_DIR="/usr/local/share/mediamtx/certs"
|
|
|
|
echo Please input the local ip of this machine, where video services would be started && read LOCAL_IP
|
|
echo "${LOCAL_IP}" > "${WORK_DIR}/.ipaddr"
|
|
|
|
mkdir -p /var/lib/mediamtx
|
|
mkdir -p "${CERT_DIR}"
|
|
|
|
ln -s "$WORK_DIR/mediamtx.yml" /etc
|
|
ln -s "$WORK_DIR/bin/h264-retranslate" /usr/local/bin
|
|
ln -s "$WORK_DIR/system/h264-node@.service" /etc/systemd/system
|
|
ln -s "$WORK_DIR/system/mediamtx.service" /etc/systemd/system
|
|
|
|
openssl req -x509 -nodes -days 3650 \
|
|
-newkey rsa:2048 \
|
|
-keyout "${CERT_DIR}/mediamtx.key" \
|
|
-out "${CERT_DIR}/mediamtx.crt" \
|
|
-subj "/C=RU/ST=0/L=0/O=0/OU=0/CN=0"
|
|
|
|
systemctl enable mediamtx.service
|
|
systemctl start mediamtx.service
|
|
|
|
#systemctl enable h264-node@1000
|
|
#systemctl enable h264-node@1001
|
|
#systemctl enable h264-node@1002
|
|
#systemctl enable h264-node@1003
|
|
#systemctl enable h264-node@1004
|
|
|
|
#systemctl start h264-node@1000
|
|
#systemctl start h264-node@1001
|
|
#systemctl start h264-node@1002
|
|
#systemctl start h264-node@1003
|
|
#systemctl start h264-node@1004
|