Last active
April 16, 2024 20:04
-
-
Save adamboutcher/0dba9a9108190b1cbac588267802b6fb to your computer and use it in GitHub Desktop.
Zoom Updater for Fedora/EL
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 | |
# Install/Update Zoom on Fedora/EL | |
# v1 | |
# Adam Boutcher - 2024 - IPPP, Durham Uni (UKI-SCOTGRID-DURHAM) | |
# Zoom Linux Dowload Details | |
# https://zoom.us/rest/download?os=linux | |
# Zoom Linux Download | |
# https://zoom.us/client/6.0.0.4563/zoom_x86_64.rpm | |
#Function: Check that a binary exists | |
#Usage: check_bin command | |
function check_bin() { | |
which $1 1>/dev/null 2>&1 | |
if [[ $? -ne 0 ]]; then | |
echo "$1 cannot be found. Please install it or add it to the path. Exiting." | |
exit 1 | |
fi | |
} | |
check_bin which | |
check_bin echo | |
check_bin curl | |
check_bin yum | |
check_bin arch | |
check_bin grep | |
check_bin awk | |
check_bin jq | |
# Make sure only root can install thinkgs | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
echo "Zoom Updater (RPM)" | |
# System Arch | |
sys_arch=$(arch) | |
# This expects yum output of "Package_Name Version Repo" and is only looking for zoom, this might match weird | |
zoom_installed=$(yum list installed | grep "zoom.${sys_arch}" | awk '{print $2}' | awk -F "-" '{print $1}') | |
# Get Zoom latest version | |
zoom_latest=$(curl -s https://zoom.us/rest/download?os=linux | jq -r .result.downloadVO.zoom.version) | |
echo Zoom Installed: $zoom_installed | |
echo Zoom Available: $zoom_latest | |
if [[ ${zoom_latest} > ${zoom_installed} ]]; then | |
echo "Updating..." | |
curl -s -o /tmp/zoom_${sys_arch}.rpm -L https://zoom.us/client/${zoom_latest}/zoom_${sys_arch}.rpm | |
yum -qy localinstall /tmp/zoom_${sys_arch}.rpm | |
rm -rf /tmp/zoom_${sys_arch}.rpm | |
else | |
echo "Up to date." | |
fi | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment