@@ -7,6 +7,7 @@ function _install_zoom_latest_force() {
77 local_file=" /tmp/zoom_amd64.deb"
88 curl --fail --location --silent --output " ${local_file} " " ${url} "
99 sudo dpkg --install " ${local_file} "
10+ rm --force " ${local_file} "
1011 after_strict
1112}
1213
@@ -15,7 +16,14 @@ function _install_zoom_latest() {
1516 url=" https://zoom.us/client/latest/zoom_amd64.deb"
1617 local_file=" /tmp/zoom_amd64.deb"
1718 # Extract remote version from the redirect URL
18- remote_version=$( curl --fail --silent --head --location --output /dev/null --write-out ' %{url_effective}' " ${url} " | grep -oP ' /prod/\K[^/]+' )
19+ effective_url=$( curl --fail --silent --head --location --output /dev/null --write-out ' %{url_effective}' " ${url} " )
20+ remote_version=$( echo " ${effective_url} " | grep -oP ' /prod/\K[^/]+' )
21+ if [ -z " ${remote_version} " ]
22+ then
23+ echo " could not determine remote zoom version from [${effective_url} ]" >&2
24+ after_strict
25+ return 1
26+ fi
1927 # Get installed version (empty if not installed)
2028 installed_version=$( dpkg-query -W -f=' ${Version}' zoom 2> /dev/null || true)
2129 if [ " ${installed_version} " = " ${remote_version} " ]
@@ -27,6 +35,7 @@ function _install_zoom_latest() {
2735 echo " Upgrading zoom from [${installed_version:- not installed} ] to [${remote_version} ]"
2836 curl --fail --location --silent --output " ${local_file} " " ${url} "
2937 sudo dpkg --install " ${local_file} "
38+ rm --force " ${local_file} "
3039 after_strict
3140}
3241
@@ -43,6 +52,7 @@ function _install_zoom_6() {
4352
4453 echo " Installing Zoom ${ZOOM_VERSION} (will downgrade if newer version is installed)..."
4554 sudo dpkg -i " ${TMPFILE} " || sudo apt-get install -f -y
55+ rm --force " ${TMPFILE} "
4656 echo " Installed version:"
4757 dpkg -l zoom | tail -1
4858}
0 commit comments