Zoom: Update pattern for major release number
This commit is contained in:
parent
866f928f78
commit
565304f72d
|
@ -41,7 +41,7 @@ fi
|
|||
# }}}
|
||||
|
||||
# Vars {{{
|
||||
DEBUG=0
|
||||
DEBUG=1
|
||||
|
||||
if [ $# -eq 1 ] && [ "${1}" = "repo" ] ## If repository's version should be compared
|
||||
then
|
||||
|
@ -51,8 +51,8 @@ else
|
|||
fi
|
||||
|
||||
zoom_new_version=$(curl --silent 'https://zoom.us/support/download' --header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36' | grep "class=\"linux-ver-text\"" | sed -e 's/.*Version \(.*\)<.*/\1/')
|
||||
zoom_new_version_major=$(echo "${zoom_new_version}" | sed -e 's/\([^\.]\+\.[^\.]\+\).*/\1/')
|
||||
zoom_new_version_minor=$(echo "${zoom_new_version}" | sed -e 's/[^\(]\+(\(.*\)).*/\1/')
|
||||
zoom_new_version_major=$(echo "${zoom_new_version}" | sed -e 's/\(.*\) .*/\1/')
|
||||
zoom_new_version_minor=$(echo "${zoom_new_version}" | sed -e 's/.* (\(.*\))/\1/')
|
||||
|
||||
zoom_new_version_file="/tmp/.zoom.upgrade"
|
||||
|
||||
|
@ -70,39 +70,46 @@ if [ "${zoom_current_version}" != "${zoom_new_version_major}.${zoom_new_version_
|
|||
wget --quiet https://zoom.us/client/latest/zoom_amd64.deb --output-document="${zoom_new_pkg_path}"
|
||||
fi
|
||||
|
||||
else
|
||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — The current version is up-to-date."
|
||||
## Ensure to remove any temp file and useless .deb file
|
||||
rm --force -- "${zoom_new_version_file}" "${zoom_new_pkg_path}" "${zoom_tmp_pkg_path}"
|
||||
fi
|
||||
# }}}
|
||||
# Verify downloaded package {{{
|
||||
|
||||
# Verify downloaded package {{{
|
||||
# Check the version from dpkg info {{{
|
||||
zoom_dpkg_version=$(dpkg --info -- "${zoom_new_pkg_path}" | awk '/ Version/ { print $2 }')
|
||||
|
||||
# Check the version from dpkg info {{{
|
||||
zoom_dpkg_version=$(dpkg --info -- "${zoom_new_pkg_path}" | awk '/ Version/ { print $2 }')
|
||||
|
||||
if [ "${zoom_dpkg_version}" = "${zoom_new_version_major}.${zoom_new_version_minor}" ]; then
|
||||
if [ "${zoom_dpkg_version}" = "${zoom_new_version_major}.${zoom_new_version_minor}" ]; then
|
||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Check dpkg version — \
|
||||
New version and .deb file informations are correct."
|
||||
## Create a temp file to monitor
|
||||
touch -- "${zoom_new_version_file}"
|
||||
printf '\e[1;35m%-6s\e[m\n' "An upgrade is available for Zoom client (current : ${zoom_current_version}) : ${zoom_new_version_major}.${zoom_new_version_minor}." >> "${zoom_new_version_file}"
|
||||
|
||||
### Exit
|
||||
## Exit
|
||||
exit 0
|
||||
else
|
||||
else
|
||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Check dpkg version — \
|
||||
New version and .deb file informations mismatch, don't need to go further."
|
||||
### Ensure to remove the file to monitor
|
||||
|
||||
## Ensure to remove the file to monitor
|
||||
rm --force -- "${zoom_new_version_file}"
|
||||
|
||||
### Keep a record of the downloaded package because as a new release might come soon
|
||||
## Keep a record of the downloaded package because as a new release might come soon
|
||||
mv --force -- "${zoom_new_pkg_path}" "${zoom_tmp_pkg_path}"
|
||||
|
||||
## Exit
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# }}}
|
||||
|
||||
else
|
||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — The current version is up-to-date."
|
||||
## Ensure to remove any temp file and useless .deb file
|
||||
rm --force -- "${zoom_new_version_file}" "${zoom_new_pkg_path}" "${zoom_tmp_pkg_path}"
|
||||
|
||||
## Exit
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# }}}
|
||||
|
||||
exit 255
|
||||
|
|
Loading…
Reference in New Issue