dev-resources.site
for different kinds of informations.
A zoom installer script for linux
Published at
8/24/2023
Categories
zoom
bash
dependency
linux
Author
abbazs
Author
6 person written this
abbazs
open
Often when you install zoom in linux you would have encountered broken install issue. Here is a function to save you from installing and keeping it updated:
#!/bin/bash
set -euo pipefail
print_style() {
local style="${1:-0}"
local color="${2:-32}"
local message="${3:-$color}"
echo -e "\e[${style};${color}m${message}\e[0m"
}
get_version_from_json() {
local url="https://zoom.us/rest/download?os=linux"
curl -s "$url" | jq -r '.result.downloadVO.zoom.version'
}
get_installed_version() {
dpkg-query -W -f='${Version}' zoom 2>/dev/null || echo "Not installed"
}
download_zoom() {
local version="$1"
local filename="zoom_amd64.deb"
print_style 1 31 "Downloading Zoom version $version"
curl -LO "https://zoom.us/client/latest/$filename"
echo "$filename"
}
install_dependencies() {
local filename="$1"
local package_names
package_names=$(dpkg-deb -f "$filename" Depends | sed -e 's/,//g' -e 's/([^)]*)//g')
if [[ "$package_names" == *"|"* ]]; then
IFS='|' read -ra dep_choices <<< "$package_names"
for choice in "${dep_choices[@]}"; do
sudo apt-get install -y $choice && break
done
else
sudo apt-get install -y $package_names
fi
}
install_zoom() {
local filename="$1"
sudo dpkg -i "$filename"
sudo apt-get install -f -y
}
update_zoom() {
local latest_version
local installed_version
local filename
latest_version=$(get_version_from_json)
installed_version=$(get_installed_version)
print_style 1 34 "Latest version : $latest_version"
print_style 1 34 "Installed version: $installed_version"
if [ "$installed_version" = "$latest_version" ]; then
print_style 1 32 "The current version $installed_version is already installed."
return
fi
filename=$(download_zoom "$latest_version")
install_dependencies "$filename"
install_zoom "$filename"
rm -f "$filename"
print_style 1 32 "Zoom has been successfully updated to version $latest_version"
}
main() {
if ! command -v jq &> /dev/null; then
print_style 1 31 "jq is not installed. Please install it first."
exit 1
fi
update_zoom
}
main "$@"
dependency Article's
30 articles in total
Ore: Advanced Dependency Injection Package for Go
read article
vcpkg - how to modify dependencies
read article
CocoaPods is in Maintenance Mode
read article
Safely restructure your codebase with Dependency Graphs
read article
Understanding Dependencies in Programming
read article
A zoom installer script for linux
currently reading
Loose Coupling and Dependency Injection (DI) principle
read article
Dependency Injection in swift
read article
Dependency relation in AWS CDK
read article
CORS how to enable them in .NET?
read article
Angular Dependency Injection
read article
Dependency management made easy with Dependabot and GitHub Actions
read article
Jetpack compose โ Dependency injection with Dagger/HILT
read article
Dependencies in node project
read article
Fixing vulnerabilities found in a dependency tree
read article
How to create your own dependency injection framework in Java
read article
Reduzindo a quantidade de Branchs na criaรงรฃo de Objetos com uma estrutura plugรกvel
read article
NodeJs - Dependency injection, make it easy
read article
A Step by Step Guide to ASP.NET Core Dependency Injection
read article
The Basics of Dependency Maintenance in NPM/yarn
read article
The troubles of modern software dependency management and what to do about them
read article
Loose Coupling Basics
read article
Correctly defining CDK dependencies in L3 constructs
read article
What dependency hell looks like, and how to avoid it
read article
How to create your own dependency injection framework in Java
read article
Dependency Inversion Principle in Swift
read article
Angular: Create a custom dependency injection
read article
Dagger with a Hilt
read article
How to find what is the dependency of a function, class, or variable in ES6 via AST
read article
Data Dependency Graph
read article
Featured ones: