From 6a1e7214cd13a2c467231d05526204a129b29b0a Mon Sep 17 00:00:00 2001 From: Ark74 Date: Mon, 25 Jan 2021 03:26:00 -0600 Subject: [PATCH] Prevent to run installer on a system with jitsi already on it --- quick_jibri_installer.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index 72fa3dc..c5839f3 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -29,6 +29,17 @@ GOOGLE_ACTIVE_REPO=$(apt-cache policy | grep http | grep chrome| awk '{print $3} PROSODY_REPO=$(apt-cache policy | grep http | grep prosody| awk '{print $3}' | head -n 1 | cut -d "/" -f2) CR=`echo $'\n> '` +exit_ifinstalled() { +if [ "$(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed")" == "1" ]; then + echo " This instance already has $1 installed, exiting..." + echo " Please try again on a clean system." + echo " If you think this is an error, please report to: + -> https://github.com/switnet-ltd/quick-jibri-installer/issues " + exit +fi +} +exit_ifinstalled jitsi-meet + if [ $DIST = flidas ]; then DIST="xenial" fi