fix sed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-09-19 22:49:07 +02:00
parent 729c6c0235
commit b1ca78df66
2 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ rtmp {
live on; live on;
record off; record off;
meta copy; meta copy;
exec ffmpeg -i rtmp://localhost:1935/origin/___STREAMKEY___ -c copy -f flv rtmp://127.0.0.1:1935/live; exec ffmpeg -i rtmp://localhost:1935/origin/Ykh9hy5BxLLpqk1DuretawNz9sGxX3mt -c copy -f flv rtmp://127.0.0.1:1935/live;
} }
application live { application live {
allow publish 127.0.0.1; allow publish 127.0.0.1;

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
NGINX_CONF=/etc/nginx/nginx.conf NGINX_CONF=./nginx.conf
NGINX_INGEST_CONF=/etc/nginx/nginx_ingest.conf NGINX_INGEST_CONF=./nginx_ingest.conf
NGINX_RESTREAM_CONF=/etc/nginx/nginx_restream.conf NGINX_RESTREAM_CONF=./nginx_restream.conf
function mfcb { local val="$4"; "$1"; eval "$2[$3]=\$val;"; }; function mfcb { local val="$4"; "$1"; eval "$2[$3]=\$val;"; };
function val_ltrim { if [[ "$val" =~ ^[[:space:]]+ ]]; then val="${val:${#BASH_REMATCH[0]}}"; fi; }; function val_ltrim { if [[ "$val" =~ ^[[:space:]]+ ]]; then val="${val:${#BASH_REMATCH[0]}}"; fi; };
function val_rtrim { if [[ "$val" =~ [[:space:]]+$ ]]; then val="${val:0:${#val}-${#BASH_REMATCH[0]}}"; fi; }; function val_rtrim { if [[ "$val" =~ [[:space:]]+$ ]]; then val="${val:0:${#val}-${#BASH_REMATCH[0]}}"; fi; };
@ -26,7 +26,7 @@ if [[ $NGINX_TYPE == "ingest" ]]; then
else else
NGINX_STREAM_KEY="${STREAM_KEY}" NGINX_STREAM_KEY="${STREAM_KEY}"
fi fi
sed -i 's@___STREAMKEY___@'"$NGINX_STREAM_KEY"'@' $NGINX_INGEST_CONF > $NGINX_CONF sed 's@___STREAMKEY___@'"$NGINX_STREAM_KEY"'@' $NGINX_INGEST_CONF > $NGINX_CONF
else else
if [[ -z "${PUSH_URLS}" ]]; then if [[ -z "${PUSH_URLS}" ]]; then
echo -e "Envvar PUSH_URLS required" echo -e "Envvar PUSH_URLS required"
@ -39,7 +39,7 @@ else
: :
NGINX_PUSH_URLS=$NGINX_PUSH_URLS$'push '$i$'\n' NGINX_PUSH_URLS=$NGINX_PUSH_URLS$'push '$i$'\n'
done done
sed -i 's@___PUSH_DIRECTIVES___@'"$NGINX_PUSH_URLS"'@' $NGINX_RESTREAM_CONF > $NGINX_CONF sed 's@___PUSH_DIRECTIVES___@'"$NGINX_PUSH_URLS"'@' $NGINX_RESTREAM_CONF > $NGINX_CONF
fi fi
fi fi