#!/bin/bash

# shellcheck disable=SC2034
file="$1"

#Replace db name for local name streamup_ to licence_
# shellcheck disable=SC2016
sed -i 's/`streamup_([0-9]+)`/`streamup_\1`/g' -E "$file"

# Replace prod parameter
sed -i 's/https\:\/\/mmcdnimg\.stream\-up\.eu/http\:\/\/imgbeta\.stream-up\.local/g' -E "$file"
sed -i 's/https\:\/\/mmcdnjs\.stream\-up\.eu/http\:\/\/jsbeta\.stream-up\.local/g' -E "$file"
sed -i 's/https\:\/\/streamup\.io\//http\:\/\/io.stream-up.local\//g' -E "$file"
sed -i 's/https\:\/\/(.*).stream-up.tv/http\:\/\/\1.prod.stream-up.local/g' -E "$file"
sed -i 's/https\:\/\/(.*).key4.live/http\:\/\/\1.prod.stream-up.local/g' -E "$file"
sed -i 's/wss\:\/\/ws1.stream-up.eu/ws\:\/\/beta.prod.stream-up.local\:8080/g' -E "$file"
sed -i 's/wss\:\/\/wslive1.stream-up.eu/ws\:\/\/beta.prod.stream-up.local\:8080/g' -E "$file"

