7.0.2 #82
|
@ -20,6 +20,7 @@ fi
|
||||||
|
|
||||||
Blue='\e[0;34m'
|
Blue='\e[0;34m'
|
||||||
Purple='\e[0;35m'
|
Purple='\e[0;35m'
|
||||||
|
Red='\e[0;31m'
|
||||||
Green='\e[0;32m'
|
Green='\e[0;32m'
|
||||||
Yellow='\e[0;33m'
|
Yellow='\e[0;33m'
|
||||||
Color_Off='\e[0m'
|
Color_Off='\e[0m'
|
||||||
|
@ -40,10 +41,14 @@ support="https://switnet.net/support"
|
||||||
apt_repo="/etc/apt/sources.list.d"
|
apt_repo="/etc/apt/sources.list.d"
|
||||||
ENABLE_BLESSM="TBD"
|
ENABLE_BLESSM="TBD"
|
||||||
CHD_LTST="$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)"
|
CHD_LTST="$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)"
|
||||||
CHD_LTST_2D="$(echo "$CHD_LTST"|cut -d "." -f 1,2)"
|
CHD_LTST_2D="$(cut -d "." -f 1,2 <<< "$CHD_LTST")"
|
||||||
CHDB="$(whereis chromedriver | awk '{print$2}')"
|
CHDB="$(whereis chromedriver | awk '{print$2}')"
|
||||||
|
if [ -d /etc/prosody/conf.d/ ]; then
|
||||||
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua | \
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua | \
|
||||||
awk -F'.cfg' '!/localhost/{print $1}' | xargs basename)"
|
awk -F'.cfg' '!/localhost/{print $1}' | xargs basename)"
|
||||||
|
else
|
||||||
|
echo -e "Seems no prosody is installed...\n > is this a jibri node?"
|
||||||
|
fi
|
||||||
NC_DOMAIN="TBD"
|
NC_DOMAIN="TBD"
|
||||||
JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
||||||
if [ -f "$JITSI_MEET_PROXY" ];then
|
if [ -f "$JITSI_MEET_PROXY" ];then
|
||||||
|
@ -65,13 +70,13 @@ if [ -z "$CHDB" ]; then
|
||||||
echo "Seems no chromedriver installed"
|
echo "Seems no chromedriver installed"
|
||||||
else
|
else
|
||||||
CHD_VER_LOCAL="$($CHDB -v | awk '{print $2}')"
|
CHD_VER_LOCAL="$($CHDB -v | awk '{print $2}')"
|
||||||
CHD_VER_2D="$(echo "$CHD_VER_LOCAL"|awk '{printf "%.1f\n", $NF}')"
|
CHD_VER_2D="$(awk '{printf "%.1f\n", $NF}' <<< "$CHD_VER_LOCAL")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# True if $1 is greater than $2
|
# True if $1 is greater than $2
|
||||||
version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
|
version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
|
||||||
|
|
||||||
check_jibri() {
|
restart_jibri() {
|
||||||
if [ "$(dpkg-query -W -f='${Status}' "jibri" 2>/dev/null | grep -c "ok installed")" == "1" ]
|
if [ "$(dpkg-query -W -f='${Status}' "jibri" 2>/dev/null | grep -c "ok installed")" == "1" ]
|
||||||
then
|
then
|
||||||
systemctl restart jibri
|
systemctl restart jibri
|
||||||
|
@ -86,7 +91,7 @@ fi
|
||||||
restart_services() {
|
restart_services() {
|
||||||
systemctl restart jitsi-videobridge2
|
systemctl restart jitsi-videobridge2
|
||||||
systemctl restart jicofo
|
systemctl restart jicofo
|
||||||
check_jibri
|
restart_jibri
|
||||||
systemctl restart prosody
|
systemctl restart prosody
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +110,13 @@ update_google_repo() {
|
||||||
echo "No Google repository found"
|
echo "No Google repository found"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
GOOGL_VER_2D="$(/usr/bin/google-chrome --version|awk '{printf "%.1f\n", $NF}')"
|
printwc "${Purple}" "Checking for Google Chrome\n"
|
||||||
|
if [ -f /usr/bin/google-chrome ]; then
|
||||||
|
GOOGL_VER_2D="$(/usr/bin/google-chrome --version|awk '{printf "%.1f\n", $NF}')"
|
||||||
|
else
|
||||||
|
printwc "${Yellow}" " -> Seems there is no Google Chrome installed\n"
|
||||||
|
IS_GLG_CHRM="no"
|
||||||
|
fi
|
||||||
upgrade_cd() {
|
upgrade_cd() {
|
||||||
if [ -n "$GOOGL_VER_2D" ]; then
|
if [ -n "$GOOGL_VER_2D" ]; then
|
||||||
if version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" ; then
|
if version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" ; then
|
||||||
|
@ -139,6 +150,7 @@ if [ -f "$CHDB" ]; then
|
||||||
upgrade_cd
|
upgrade_cd
|
||||||
else
|
else
|
||||||
printwc "${Yellow}" " -> Seems there is no Chromedriver installed\n"
|
printwc "${Yellow}" " -> Seems there is no Chromedriver installed\n"
|
||||||
|
IS_CHDB="no"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +167,21 @@ else
|
||||||
echo "Please check your repositories, something is not right."
|
echo "Please check your repositories, something is not right."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
check_if_installed(){
|
||||||
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
||||||
|
echo "1"
|
||||||
|
else
|
||||||
|
echo "0"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
check_for_jibri_node() {
|
||||||
|
if [ "$(check_if_installed jibri)" = 1 ] && \
|
||||||
|
[ "$(check_if_installed jitsi-meet)" = 0 ] && \
|
||||||
|
[ "$(check_if_installed prosody)" = 0 ]; then
|
||||||
|
printwc "${Green}" "\n::: This seems to be a jibri node :::\n"
|
||||||
|
JIBRI_NODE="yes"
|
||||||
|
fi
|
||||||
|
}
|
||||||
# Any customization, image, name or link change for any purpose should
|
# Any customization, image, name or link change for any purpose should
|
||||||
# be documented here so new updates won't remove those changes.
|
# be documented here so new updates won't remove those changes.
|
||||||
# We divide them on UI changes and branding changes, feel free to adapt
|
# We divide them on UI changes and branding changes, feel free to adapt
|
||||||
|
@ -165,13 +192,16 @@ fi
|
||||||
########################################################################
|
########################################################################
|
||||||
# User interface changes #
|
# User interface changes #
|
||||||
########################################################################
|
########################################################################
|
||||||
|
#Check for jibri node
|
||||||
|
check_for_jibri_node
|
||||||
|
|
||||||
|
[ "$JIBRI_NODE" != yes ] && \
|
||||||
if [ -f "$INT_CONF_ETC" ]; then
|
if [ -f "$INT_CONF_ETC" ]; then
|
||||||
echo "Static interface_config.js exists, skipping modification..."
|
echo "Static interface_config.js exists, skipping modification..."
|
||||||
else
|
else
|
||||||
echo "This setup doesn't have a static interface_config.js, checking changes..."
|
echo "This setup doesn't have a static interface_config.js, checking changes..."
|
||||||
printwc "${Purple}" "========== Setting Static Avatar ==========\n"
|
printwc "${Purple}" "========== Setting Static Avatar ==========\n"
|
||||||
if [[ -z "$AVATAR" ]]; then
|
if [ -z "$AVATAR" ]; then
|
||||||
echo "Moving on..."
|
echo "Moving on..."
|
||||||
else
|
else
|
||||||
echo "Setting Static Avatar"
|
echo "Setting Static Avatar"
|
||||||
|
@ -179,7 +209,7 @@ else
|
||||||
sed -i "/RANDOM_AVATAR_URL_SUFFIX/ s|false|\'.png\'|" "$INT_CONF"
|
sed -i "/RANDOM_AVATAR_URL_SUFFIX/ s|false|\'.png\'|" "$INT_CONF"
|
||||||
fi
|
fi
|
||||||
printwc "${Purple}" "========== Setting Support Link ==========\n"
|
printwc "${Purple}" "========== Setting Support Link ==========\n"
|
||||||
if [[ -z "$support" ]]; then
|
if [ -z "$support" ]; then
|
||||||
echo "Moving on..."
|
echo "Moving on..."
|
||||||
else
|
else
|
||||||
echo "Setting Support custom link"
|
echo "Setting Support custom link"
|
||||||
|
@ -189,6 +219,7 @@ else
|
||||||
sed -i "s|'videobackgroundblur', ||" "$INT_CONF"
|
sed -i "s|'videobackgroundblur', ||" "$INT_CONF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ "$JIBRI_NODE" != yes ] && \
|
||||||
if [ "$NC_DOMAIN" != "TBD" ]; then
|
if [ "$NC_DOMAIN" != "TBD" ]; then
|
||||||
printwc "${Purple}" "========== Enable $NC_DOMAIN for sync client ==========\n"
|
printwc "${Purple}" "========== Enable $NC_DOMAIN for sync client ==========\n"
|
||||||
if [ -z "$PREAD_PROXY" ]; then
|
if [ -z "$PREAD_PROXY" ]; then
|
||||||
|
@ -201,12 +232,27 @@ printwc "${Purple}" "========== Enable $NC_DOMAIN for sync client ==========\n"
|
||||||
echo "$NC_DOMAIN seems to be on place, skipping..."
|
echo "$NC_DOMAIN seems to be on place, skipping..."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
restart_services
|
if [ "$JIBRI_NODE" = "yes" ]; then
|
||||||
|
restart_jibri
|
||||||
|
else
|
||||||
|
restart_services
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$JIBRI_NODE" = "yes" ] && \
|
||||||
|
[ "$IS_CHDB" = "no" ] && \
|
||||||
|
[ "$IS_GLG_CHRM" = "no" ];then
|
||||||
|
printwc "${Red}" "\nBeware: This jibri node seems to be missing important packages.\n"
|
||||||
|
echo " > Googe Chrome"
|
||||||
|
echo " > Chromedriver"
|
||||||
|
fi
|
||||||
########################################################################
|
########################################################################
|
||||||
# Brandless mode #
|
# Brandless mode #
|
||||||
########################################################################
|
########################################################################
|
||||||
if [ "$ENABLE_BLESSM" = "on" ]; then
|
if [ "$ENABLE_BLESSM" = "on" ]; then
|
||||||
|
if [ "$MODE" = "debug" ]; then
|
||||||
|
bash "$PWD"/jm-bm.sh -m debug
|
||||||
|
else
|
||||||
bash "$PWD"/jm-bm.sh
|
bash "$PWD"/jm-bm.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
printwc "${Blue}" "Script completed \o/!\n"
|
printwc "${Blue}" "Script completed \o/!\n"
|
||||||
|
|
2
jm-bm.sh
2
jm-bm.sh
|
@ -67,7 +67,7 @@ sed -i "s|jitsilogo.png|watermark2.png|g" "$TITLE_FILE"
|
||||||
sed -i "s|logo-deep-linking.png|watermark2.png|g" "$BUNDLE_JS"
|
sed -i "s|logo-deep-linking.png|watermark2.png|g" "$BUNDLE_JS"
|
||||||
sed -i "s|jitsiLogo_square.png|gnome_record.png|g" "$BUNDLE_JS"
|
sed -i "s|jitsiLogo_square.png|gnome_record.png|g" "$BUNDLE_JS"
|
||||||
#Disable logo and url
|
#Disable logo and url
|
||||||
if ! grep -nr ".leftwatermark{display:none" "$CSS_FILE" ; then
|
if ! grep -q ".leftwatermark{display:none" "$CSS_FILE" ; then
|
||||||
sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" "$CSS_FILE"
|
sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" "$CSS_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1092,7 +1092,11 @@ sleep .1
|
||||||
###JWT
|
###JWT
|
||||||
if [ "$ENABLE_JWT" = "yes" ]; then
|
if [ "$ENABLE_JWT" = "yes" ]; then
|
||||||
printf "\nJWT auth is being setup...\n"
|
printf "\nJWT auth is being setup...\n"
|
||||||
|
if [ "$MODE" = "debug" ]; then
|
||||||
|
bash "$PWD"/mode/jwt.sh -m debug
|
||||||
|
else
|
||||||
bash "$PWD"/mode/jwt.sh
|
bash "$PWD"/mode/jwt.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
sleep .1
|
sleep .1
|
||||||
#Guest allow
|
#Guest allow
|
||||||
|
@ -1201,7 +1205,11 @@ fi
|
||||||
if [ "$ENABLE_BLESSM" = "yes" ]; then
|
if [ "$ENABLE_BLESSM" = "yes" ]; then
|
||||||
echo "Custom brandless mode will be enabled."
|
echo "Custom brandless mode will be enabled."
|
||||||
sed -i "s|ENABLE_BLESSM=.*|ENABLE_BLESSM=\"on\"|" jitsi-updater.sh
|
sed -i "s|ENABLE_BLESSM=.*|ENABLE_BLESSM=\"on\"|" jitsi-updater.sh
|
||||||
|
if [ "$MODE" = "debug" ]; then
|
||||||
|
bash "$PWD"/jm-bm.sh -m debug
|
||||||
|
else
|
||||||
bash "$PWD"/jm-bm.sh
|
bash "$PWD"/jm-bm.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Applying best practives for interface config.js
|
# Applying best practives for interface config.js
|
||||||
|
|
Loading…
Reference in New Issue