From efb8552ec756ef01bebc53c3704857ae66a9e3de Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 18 Feb 2021 02:21:59 -0600 Subject: [PATCH] Yet again another standarize effort --- jitsi-updater.sh | 19 ++++++++++--------- quick_jibri_installer.sh | 3 ++- tools/test-jibri-env.sh | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/jitsi-updater.sh b/jitsi-updater.sh index e82a35f..a8745d6 100644 --- a/jitsi-updater.sh +++ b/jitsi-updater.sh @@ -44,8 +44,8 @@ fi if [ -z $CHDB ]; then echo "Seems no chromedriver installed" else - CHD_AVB="$($CHDB -v | awk '{print $2}')" - CHD_AVB_2D="$(echo $CHD_AVB|cut -d "." -f 1,2)" + CHD_VER_LOCAL="$($CHDB -v | awk '{print $2}')" + CHD_VER_2D="$(echo $CHD_VER_LOCAL|cut -d "." -f 1,2)" fi # True if $1 is greater than $2 @@ -90,16 +90,17 @@ upgrade_cd() { if [ ! -z $GOOGL_VER_2D ]; then if version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" && \ [ "$GOOGL_VER_2D" = "$CHD_LTST_2D" ]; then - then echo "Upgrading Chromedriver to Google Chromes version" - wget https://chromedriver.storage.googleapis.com/$CHD_LTST/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo cp chromedriver $CHDB - rm -rf chromedriver chromedriver_linux64.zip + wget -q https://chromedriver.storage.googleapis.com/$CHD_LTST/chromedriver_linux64.zip \ + -O /tmp/chromedriver_linux64.zip + unzip /tmp/chromedriver_linux64.zip -d /usr/local/bin/ + chown root:root $CHDB + chmod 0755 $CHDB + rm -rf /tpm/chromedriver_linux64.zip chromedriver -v else echo "No need to upgrade Chromedriver" - printf "Current version: ${Green} $CHD_AVB_2D ${Color_Off}\n" + printf "Current version: ${Green} $CHD_VER_2D ${Color_Off}\n" fi else printf "${Yellow} -> No Google Chrome versiĆ³n to match, leaving untouched.${Color_Off}\n" @@ -109,7 +110,7 @@ fi check_lst_cd() { printf "${Purple}Checking for the latest Chromedriver${Color_Off}\n" if [ -f $CHDB ]; then - printf "Current installed Chromedriver: ${Yellow} $CHD_AVB_2D ${Color_Off}\n" + printf "Current installed Chromedriver: ${Yellow} $CHD_VER_2D ${Color_Off}\n" printf "Current installed Google Chrome: ${Green} $GOOGL_VER_2D ${Color_Off}\n" upgrade_cd else diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index 1913284..cd3cfe9 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -379,7 +379,8 @@ if [ -f /usr/local/bin/chromedriver ]; then echo "Chromedriver already installed." else echo "Installing Chromedriver" - wget -q https://chromedriver.storage.googleapis.com/$CHD_LTST/chromedriver_linux64.zip -O /tmp/chromedriver_linux64.zip + wget -q https://chromedriver.storage.googleapis.com/$CHD_LTST/chromedriver_linux64.zip \ + -O /tmp/chromedriver_linux64.zip unzip /tmp/chromedriver_linux64.zip -d /usr/local/bin/ chown root:root /usr/local/bin/chromedriver chmod 0755 /usr/local/bin/chromedriver diff --git a/tools/test-jibri-env.sh b/tools/test-jibri-env.sh index 87d905a..167687f 100644 --- a/tools/test-jibri-env.sh +++ b/tools/test-jibri-env.sh @@ -117,7 +117,8 @@ if [ ! -z "$CHD_VER_LOCAL" ] && [ ! -z "$GOOGL_VER_LOCAL" ]; then elif version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" && \ [ "$GOOGL_VER_2D" = "$CHD_LTST_2D" ]; then echo -e "\nAttempting Chromedriver update!" - wget -q https://chromedriver.storage.googleapis.com/$CHD_LTST/chromedriver_linux64.zip -O /tmp/chromedriver_linux64.zip + wget -q https://chromedriver.storage.googleapis.com/$CHD_LTST/chromedriver_linux64.zip \ + -O /tmp/chromedriver_linux64.zip unzip /tmp/chromedriver_linux64.zip -d /usr/local/bin/ chown root:root $CHDB chmod 0755 $CHDB