From 62436daec5d6043ee9b16d8eba13a87de05d5353 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 16 Dec 2020 03:01:35 -0600 Subject: [PATCH] Improve chrome repo detection --- add-jibri-node.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/add-jibri-node.sh b/add-jibri-node.sh index 1cb25ea..70701c6 100644 --- a/add-jibri-node.sh +++ b/add-jibri-node.sh @@ -53,6 +53,7 @@ DIR_RECORD="/var/jbrecord" REC_DIR="/home/jibri/finalize_recording.sh" CHD_VER="$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)" GOOGL_REPO="/etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list" +GOOGLE_ACTIVE_REPO=$(apt-cache policy | grep http | grep chrome| awk '{print $3}' | head -n 1 | cut -d "/" -f2) GCMP_JSON="/etc/opt/chrome/policies/managed/managed_policies.json" PUBLIC_IP="$(dig -4 @resolver1.opendns.com ANY myip.opendns.com +short)" NJN_RAND_TAIL="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 4 | head -n1)" @@ -240,7 +241,7 @@ apt-get -y install \ openjdk-8-jre-headless echo "# Installing Google Chrome / ChromeDriver" -if [ -f $GOOGL_REPO ]; then +if [ "$GOOGLE_ACTIVE_REPO" = "main" ]; then echo "Google repository already set." else echo "Installing Google Chrome Stable"