From acbe709740ac74123b416f96a35fe5e70a8d2358 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Fri, 8 May 2020 21:46:18 -0500 Subject: [PATCH] Set additional jibri node variables --- quick_jibri_installer.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index f50791a..dc6186c 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -20,7 +20,7 @@ set -x fi # SYSTEM SETUP -JITSI_STBL_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1) +JITSI_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1) CERTBOT_REPO=$(apt-cache policy | grep http | grep certbot | head -n 1 | awk '{print $2}' | cut -d "/" -f4) APACHE_2=$(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") NGINX=$(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed") @@ -97,6 +97,10 @@ Adding cerbot (formerly letsencrypt) PPA repository for latest updates apt-get -yq2 dist-upgrade fi } +# sed limiters for add-jibri-node.sh variables +var_dlim() { + grep -n $1 add-jibri-node.sh|head -n1|cut -d ":" -f1 +} clear echo ' @@ -139,10 +143,14 @@ read -n 1 -s -r -p "Press any key to continue..."$'\n' fi # Jitsi-Meet Repo echo "Add Jitsi key" -if [ "$JITSI_STBL_REPO" = "stable" ]; then +if [ "$JITSI_REPO" = "stable" ]; then echo "Jitsi stable repository already installed" else +<<<<<<< HEAD echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list +======= + echo 'deb http://download.jitsi.org unstable/' > /etc/apt/sources.list.d/jitsi-unstable.list +>>>>>>> 2dd120e... Set additional jibri node variables wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add - fi #Default to LE SSL? @@ -643,6 +651,17 @@ cat << CONF_JSON > $CONF_JSON } CONF_JSON +#Setting varibales for add-jibri-node.sh +sed -i "s|MAIN_SRV_DIST=.*|MAIN_SRV_DIST=\"$DIST\"|" add-jibri-node.sh +sed -i "s|MAIN_SRV_REPO=.*|MAIN_SRV_REPO=\"$JITSI_REPO\"|" add-jibri-node.sh +sed -i "s|MAIN_SRV_DOMAIN=.*|MAIN_SRV_DOMAIN=\"$DOMAIN\"|" add-jibri-node.sh +sed -i "s|JB_NAME=.*|JB_NAME=\"$JB_NAME\"|" add-jibri-node.sh +sed -i "s|JibriBrewery=.*|JibriBrewery=\"$JibriBrewery\"|" add-jibri-node.sh +sed -i "s|JB_AUTH_PASS=.*|JB_AUTH_PASS=\"$JB_AUTH_PASS\"|" add-jibri-node.sh +sed -i "s|JB_REC_PASS=.*|JB_REC_PASS=\"$JB_REC_PASS\"|" add-jibri-node.sh +sed -i "$(var_dlim 0_LAST),$(var_dlim 1_LAST){s|LETS: .*|LETS: $(date -R)|}" add-jibri-node.sh +echo "Last file edition at: $(grep "LETS:" add-jibri-node.sh|head -n1|awk -F'LETS:' '{print$2}')" + #Tune webserver for Jitsi App control if [ -f $WS_CONF ]; then sed -i "/Anything that didn't match above/i \\\n" $WS_CONF