Last active
August 29, 2023 08:25
-
-
Save MaesterZ/94731e1c36b87eecb9f46ab68f80992a to your computer and use it in GitHub Desktop.
Zoom on Linux - Automatic installer / updater for Debian based distros [ bash script ]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# Who knew? Zoom is very probably coded like crap, they are not able to setup | |
# a proper APT repository, but at least there is a Linux client... | |
# The recent versions eat all your CPU if you have don not have a real GPU, | |
# not like Intel has between 60% and 80% market share! Right? RIGHT? | |
# https://www.statista.com/statistics/754557/worldwide-gpu-shipments-market-share-by-vendor/ | |
# Debian, Ubuntu, Linux Mint | |
# https://support.zoom.us/hc/en-us/articles/205759689-New-updates-for-Linux | |
# https://support.zoom.us/hc/en-us/articles/204206269-Installing-Zoom-on-Linux | |
current_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | |
date | |
if [[ -s /opt/zoom/version.txt ]] | |
then | |
current_version="$(cat /opt/zoom/version.txt)" | |
echo -e "\n### Current Zoom version: ${current_version}" | |
else | |
current_version="" | |
echo -e "\n### Fresh install\n" | |
fi | |
pushd "${current_dir}" > /dev/null | |
# Re-retrieve file only if remote newer than local | |
echo -e '\n### Download debian package\n' | |
# Yes, it's for real, Zoom has no APT repository (but you see AWS is doing the same with V2 of its CLI) | |
pkg_name='zoom_amd64.deb' | |
wget -N "https://zoom.us/client/latest/${pkg_name}" | |
pkg_version="$(dpkg -I ${pkg_name} | grep 'Version:' | awk '{print $2}')" | |
# Download URL for a specific version | |
# specific_version='5.9.1.1380' | |
# wget -N "https://zoom.us/client/${specific_version}/zoom_amd64.deb" | |
if [[ "${current_version}" != "${pkg_version}" ]] | |
then | |
echo -e '### Stop Zoom (if running)\n' | |
pids="$(pgrep zoom)" | |
for pid in ${pids} | |
do | |
echo "Killing PID ${pid}..." | |
# Don't kill yourself | |
[[ "${pid}" != "${$}" ]] && kill "${pid}" | |
done | |
echo -e '\n### Cleanup Zoom crap\n' | |
# Leave no crap behind | |
rm -frv ~/.cache/*qt* ~/.cache/zoom* ~/.cache/*qml* | |
echo -e '\n### Install debian package\n' | |
sudo apt install ./${pkg_name} | |
echo -e "\n### New Zoom version: $(cat /opt/zoom/version.txt)\n" | |
popd > /dev/null | |
echo -e '### Start Zoom' | |
nohup zoom >/dev/null 2>&1 & | |
else | |
echo -e '### No new version available\n' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment