🔧 various small fixes
This commit is contained in:
parent
ac1803fc00
commit
93c5d8ca6d
2 changed files with 20 additions and 6 deletions
|
|
@ -25,7 +25,7 @@ needs_commands() { # $cmd1 $cmd2 ...
|
|||
return 0
|
||||
}
|
||||
|
||||
needs_commands "xidel"
|
||||
needs_commands "xidel" "curl" || exit 1
|
||||
|
||||
echo -n "Downloading citrix update page ... " >&2
|
||||
html_data="$(curl -sSfL 'https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html')"
|
||||
|
|
@ -66,7 +66,7 @@ for key in "${!links[@]}"; do
|
|||
fi
|
||||
|
||||
# extract checksum only (64 hex digits)
|
||||
csum="$( echo "${csums["${key}"]}" | grep -Eo "\<[[:xdigit:]]{64}\>" )"
|
||||
csum="$(echo "${csums["${key}"]}" | grep -Eo "\<[[:xdigit:]]{64}\>")"
|
||||
|
||||
citrix_data["${csum}"]="${link}"
|
||||
done
|
||||
|
|
@ -188,7 +188,7 @@ download_gui() { # $link $csum $destfile
|
|||
}
|
||||
|
||||
install_deb() { # $name
|
||||
needs_commands "dpkg-query" "gdebi-gtk" || return 1
|
||||
needs_commands "dpkg-query" "zenity" "gdebi-gtk" || return 1
|
||||
|
||||
local arch
|
||||
arch="$(uname -m)"
|
||||
|
|
@ -204,16 +204,22 @@ install_deb() { # $name
|
|||
fi
|
||||
|
||||
local csum
|
||||
csum="$( echo "${link}" | cut -d' ' -f1 )"
|
||||
link="$( echo "${link}" | cut -d' ' -f2 )"
|
||||
csum="$(echo "${link}" | cut -d' ' -f1)"
|
||||
link="$(echo "${link}" | cut -d' ' -f2)"
|
||||
|
||||
local version_available
|
||||
version_available="$(echo "${link}" | sed -r 's/^.*\/[^_]+_([[:digit:]\.]+)_[^\.]+\.deb.*$/\1/')"
|
||||
|
||||
local version_installed
|
||||
if version_installed="$(dpkg-query --show --showformat='${Version}\n' ${1} &> /dev/null)" \
|
||||
if version_installed="$(dpkg-query --show --showformat='${Version}\n' "${1}")" \
|
||||
&& [ "${version_available}" = "${version_installed}" ]; then
|
||||
echo "Newest version already installed!" >&2
|
||||
zenity \
|
||||
--notification \
|
||||
--window-icon="info" \
|
||||
--text="Citrix \"${1}\": Newest version is installed!"
|
||||
sleep 2
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
# if running bash
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
# include .bashrc if it exists
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
fi
|
||||
fi
|
||||
|
||||
_include_bindir_in_path() {
|
||||
if [ -d "${1}" ]; then
|
||||
real_bin_dir="$(readlink -f "${1}" )"
|
||||
|
|
|
|||
Loading…
Reference in a new issue