From 3b7f74d8a292dc5268dc771be855a3dab0113b37 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 1 Oct 2020 02:12:09 -0500 Subject: [PATCH] Add jibri conf test --- tools/test-jibri-env.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tools/test-jibri-env.sh b/tools/test-jibri-env.sh index f7a56db..a53f4c4 100644 --- a/tools/test-jibri-env.sh +++ b/tools/test-jibri-env.sh @@ -37,15 +37,17 @@ apt -yq2 install apt-show-versions JITSI_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1) SND_AL_MODULE=$(lsmod | awk '{print$1}'| grep snd_aloop) HWE_VIR_MOD=$(apt-cache madison linux-modules-extra-virtual-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "extra-virtual-hwe") +CONF_JSON="/etc/jitsi/jibri/config.json" +JIBRI_CONF="/etc/jitsi/jibri/jibri.conf" -echo -e "\n# Check repository\n" +echo -e "\n# -- Check repository --\n" if [ -z $JITSI_REPO ]; then echo "No repository detected, wait whaaaat?..." else echo "This installation is using the \"$JITSI_REPO\" repository." fi -echo -e "\n# Check latest updates for jibri\n" +echo -e "\n# -- Check latest updates for jibri --\n" if [ "$(dpkg-query -W -f='${Status}' jibri 2>/dev/null | grep -c "ok installed")" == "1" ]; then echo "Jibri is installed, checking version:" apt-show-versions jibri @@ -57,7 +59,7 @@ fi echo -e "\nAttempting (any possible) jibri upgrade!" apt -y install --only-upgrade jibri -echo -e "\n# Test kernel modules\n" +echo -e "\n# -- Test kernel modules --\n" if [ -z $SND_AL_MODULE ]; then echo -e "No module snd_aloop detected.\nIf you just installed a new kernel, \ please try rebooting.\nFor now wait 'til the end of the recommended kernel installation." @@ -73,7 +75,7 @@ please try rebooting.\nFor now wait 'til the end of the recommended kernel insta else echo -e "Great!\nModule snd-aloop found!" fi -echo -e "\n# Test .asoundrc file\n" +echo -e "\n# -- Test .asoundrc file --\n" ASRC_MASTER="https://raw.githubusercontent.com/jitsi/jibri/master/resources/debian-package/etc/jitsi/jibri/asoundrc" ASRC_INSTALLED="/home/jibri/.asoundrc" ASRC_MASTER_MD5SUM=$(curl -sL $ASRC_MASTER | md5sum | cut -d ' ' -f 1) @@ -85,9 +87,23 @@ else echo "asoundrc files differ, if you have errors, you might wanna check this file!" fi -echo -e "\n# Old or new config (ToDo)\n" +echo -e "\n# -- Old or new config --\n" echo -e "What config version is this using?" -echo -e "(Not implemented yet)" +if [ -f ${CONF_JSON}_disabled ] && \ + [ -f $JIBRI_CONF ] && \ + [ -f $JIBRI_CONF-dpkg-file ]; then + echo -e "\n> This jibri config has been upgraded already.\n\nIf you think there maybe an error on checking you current jibri configuration.\nPlease report this to \ +https://github.com/switnet-ltd/quick-jibri-installer/issues\n" +elif [ ! -f $CONF_JSON ] && \ + [ -f $JIBRI_CONF ] && \ + [ -f ${JIBRI_CONF}-dpkg-file ]; then + echo -e "\n> This jibri seems to be running the lastest configuration already.\n\nIf you think there maybe an error on checking you current jibri configuration.\nPlease report this to \ +https://github.com/switnet-ltd/quick-jibri-installer/issues\n" +elif [ -f ${CONF_JSON}_disabled ] && \ + [ -f $JIBRI_CONF ]; then + echo -e "\n> This jibri config seems to be candidate for upgrading.\nIf you think there maybe an error on checking you current jibri configuration.\nPlease report this to \ +https://github.com/switnet-ltd/quick-jibri-installer/issues\n" +fi echo -e "\nJibri Test complete, thanks for testing.\n"