Actualiser install_multistream_rtmp.sh

This commit is contained in:
Philippe Favre
2025-01-16 16:37:46 +00:00
parent f6d7b75063
commit a72476a786

View File

@@ -37,10 +37,10 @@ make || exit 1
# Install Nginx (this will replace the previous installation)
sudo make install || exit 1
# Read streaming keys and allowed IP from environment variables (or use default values)
TWITCH_KEY=${TWITCH_KEY:-<your_twitch_key_default>}
YOUTUBE_KEY=${YOUTUBE_KEY:-<your_youtube_key_default>}
ALLOWED_IP=${ALLOWED_IP:-192.168.1.100}
# Prompt for streaming keys and allowed IP
read -p "Enter your Twitch streaming key: " TWITCH_KEY
read -p "Enter your YouTube streaming key: " YOUTUBE_KEY
read -p "Enter the IP address allowed to publish streams: " ALLOWED_IP
# Write the RTMP configuration to the nginx.conf file
sudo tee -a /etc/nginx/nginx.conf > /dev/null << EOL
@@ -68,7 +68,7 @@ rtmp {
}
# Application for local testing
application live {
application local {
live on;
record off;
}
@@ -108,4 +108,7 @@ sudo iptables -A OUTPUT -p tcp --sport 1935 -j ACCEPT
sudo iptables -A INPUT -p tcp --match multiport --dports 32768:61000 -j ACCEPT
# Save the iptables rules
sudo netfilter-persistent save
sudo netfilter-persistent save
# Confirm the location of the configuration file
echo "Nginx configuration file is located at: /etc/nginx/nginx.conf"