Handle/Check version missmatch of 'google chrome and 'chromedriver'.
This commit is contained in:
parent
5d64abb7ba
commit
3d83cfbb61
17
README.error.Jibri-ChromDriver
Normal file
17
README.error.Jibri-ChromDriver
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
# Version of google chrome must match the version of chromedriver
|
||||
#
|
||||
# You’ll see an error like this, if you updated your google-chrome to 83 & not the chromedriver to 83
|
||||
#
|
||||
org.jitsi.jibri.api.xmpp.XmppApi.run() Error starting Jibri service : org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 81
|
||||
(Driver info: chromedriver=81.0.4044.138 (8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}),platform=Linux 4.19.0-9-amd64 x86_64) (WARNING: The server did not provide any stacktrace information)
|
||||
Command duration or timeout: 273 milliseconds
|
||||
|
||||
# Get version of google-chrom
|
||||
#
|
||||
aptitude versions google-chrome-stable
|
||||
|
||||
# Get version of chromedriver
|
||||
#
|
||||
/usr/local/bin/chromedriver --version
|
229
compare_chrome__driver_versions.sh
Executable file
229
compare_chrome__driver_versions.sh
Executable file
@ -0,0 +1,229 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# =============================================================================
|
||||
#
|
||||
# To allow normal users using this script to enable recording, then add
|
||||
#
|
||||
# ALL ALL = (root) NOPASSWD: /usr/local/src/jitsi/jitsi_enable_recording.sh
|
||||
#
|
||||
# to file '/etc/sudoers.d/50-user'
|
||||
#
|
||||
# =============================================================================
|
||||
|
||||
script_name="$(basename $(realpath $0))"
|
||||
working_dir="$(dirname $(realpath $0))"
|
||||
|
||||
#conf_file="${working_dir}/conf/${script_name%%.*}.conf"
|
||||
conf_file="${working_dir}/conf/jitsi.conf"
|
||||
|
||||
LOCK_DIR="/tmp/$(basename $0).$$.LOCK"
|
||||
log_file="${LOCK_DIR}/${script_name%%.*}.log"
|
||||
|
||||
|
||||
# ----------
|
||||
# Base Function(s)
|
||||
# ----------
|
||||
|
||||
clean_up() {
|
||||
|
||||
# Perform program exit housekeeping
|
||||
rm -rf "$LOCK_DIR"
|
||||
blank_line
|
||||
exit $1
|
||||
}
|
||||
|
||||
echononl(){
|
||||
if $terminal ; then
|
||||
echo X\\c > /tmp/shprompt$$
|
||||
if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then
|
||||
echo -e -n " $*\\c" 1>&2
|
||||
else
|
||||
echo -e -n " $*" 1>&2
|
||||
fi
|
||||
rm /tmp/shprompt$$
|
||||
fi
|
||||
}
|
||||
fatal(){
|
||||
echo ""
|
||||
if $terminal ; then
|
||||
echo -e " [ \033[31m\033[1mFatal\033[m ] $*"
|
||||
else
|
||||
echo -e " [ Fatal ] $*"
|
||||
fi
|
||||
echo ""
|
||||
if $terminal ; then
|
||||
echo -e " \033[1mScript terminated\033[m.."
|
||||
else
|
||||
echo -e " Script terminated.."
|
||||
fi
|
||||
echo ""
|
||||
rm -rf $LOCK_DIR
|
||||
exit 1
|
||||
}
|
||||
error (){
|
||||
echo ""
|
||||
if $terminal ; then
|
||||
echo -e " [ \033[31m\033[1mError\033[m ] $*"
|
||||
else
|
||||
echo " [ Error ] $*"
|
||||
fi
|
||||
echo ""
|
||||
}
|
||||
|
||||
warn (){
|
||||
if $terminal ; then
|
||||
echo ""
|
||||
echo -e " [ \033[33m\033[1mWarning\033[m ] $*"
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo " [ Warning ] $*"
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
notice (){
|
||||
if $terminal ; then
|
||||
echo ""
|
||||
echo -e " [ \033[33m\033[1mNotice\033[m ] $*"
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo " [ Notice ] $*"
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
info (){
|
||||
if $terminal ; then
|
||||
echo ""
|
||||
echo -e " [ \033[32m\033[1mInfo\033[m ] $*"
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
echo_ok() {
|
||||
if $terminal ; then
|
||||
echo -e "\033[85G[ \033[32mok\033[m ]"
|
||||
fi
|
||||
}
|
||||
echo_done() {
|
||||
if $terminal ; then
|
||||
echo -e "\033[85G[ \033[32mdone\033[m ]"
|
||||
fi
|
||||
}
|
||||
echo_failed(){
|
||||
if $terminal ; then
|
||||
echo -e "\033[85G[ \033[1;31mfailed\033[m ]"
|
||||
fi
|
||||
}
|
||||
echo_skipped() {
|
||||
if $terminal ; then
|
||||
echo -e "\033[85G[ \033[33m\033[1mskipped\033[m ]"
|
||||
fi
|
||||
}
|
||||
echo_wait(){
|
||||
if $terminal ; then
|
||||
echo -en "\033[85G[ \033[5m\033[1m..\033[m ]"
|
||||
fi
|
||||
}
|
||||
|
||||
trim() {
|
||||
local var="$*"
|
||||
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
|
||||
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
|
||||
echo -n "$var"
|
||||
}
|
||||
|
||||
blank_line() {
|
||||
if $terminal ; then
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
detect_os () {
|
||||
|
||||
if $(which lsb_release > /dev/null 2>&1) ; then
|
||||
|
||||
DIST="$(lsb_release -i | awk '{print tolower($3)}')"
|
||||
DIST_VERSION="$(lsb_release -r | awk '{print tolower($2)}')"
|
||||
DIST_CODENAME="$(lsb_release -c | awk '{print tolower($2)}')"
|
||||
|
||||
if [[ "$DIST" = "debian" ]]; then
|
||||
if $(echo "$DIST_VERSION" | grep -q '\.') ; then
|
||||
DIST_VERSION=$(echo "$DIST_VERSION" | cut --delimiter='.' -f1)
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [[ -e "/etc/os-release" ]]; then
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
DIST=$ID
|
||||
DIST_VERSION=${VERSION_ID}
|
||||
|
||||
fi
|
||||
|
||||
# remove whitespace from DIST and DIST_VERSION
|
||||
DIST="${DIST// /}"
|
||||
DIST_VERSION="${DIST_VERSION// /}"
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
# ----------
|
||||
# - Jobhandling
|
||||
# ----------
|
||||
|
||||
# - Run 'clean_up' for signals SIGHUP SIGINT SIGTERM
|
||||
# -
|
||||
trap clean_up SIGHUP SIGINT SIGTERM
|
||||
|
||||
# - Create lock directory '$LOCK_DIR"
|
||||
#
|
||||
mkdir "$LOCK_DIR"
|
||||
|
||||
|
||||
# ----------
|
||||
# - Some checks ..
|
||||
# ----------
|
||||
|
||||
# - Running in a terminal?
|
||||
# -
|
||||
if [[ -t 1 ]] ; then
|
||||
terminal=true
|
||||
else
|
||||
terminal=false
|
||||
fi
|
||||
|
||||
|
||||
# ==========
|
||||
# - Begin Main Script
|
||||
# ==========
|
||||
|
||||
# ----------
|
||||
# - Headline
|
||||
# ----------
|
||||
|
||||
if $terminal ; then
|
||||
echo ""
|
||||
echo -e "\033[1m----------\033[m"
|
||||
echo -e "\033[32m\033[1mRunning script \033[m\033[1m$script_name\033[32m .. \033[m"
|
||||
echo -e "\033[1m----------\033[m"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
||||
VERSION_GOOGLE_CHROME="$(aptitude versions google-chrome-stable | awk '{print$2}' | cut -d'.' -f1)"
|
||||
VERSION_CHROME_DRIVER="$(/usr/local/bin/chromedriver --version | awk '{print$2}' | cut -d'.' -f1)"
|
||||
|
||||
if [[ "$VERSION_GOOGLE_CHROME" != "$VERSION_CHROME_DRIVER" ]]; then
|
||||
error "Version of 'google chrome' (${VERSION_GOOGLE_CHROME}) does not match version of 'chromedriver (${VERSION_CHROME_DRIVER})."
|
||||
else
|
||||
info "Version of 'google chrome' matches version of 'chromedriver' - all is fine"
|
||||
fi
|
||||
|
||||
|
||||
clean_up 0
|
||||
|
Loading…
Reference in New Issue
Block a user