🔧 various small fixes

This commit is contained in:
Jörn-Michael Miehe 2025-10-30 14:58:34 +01:00
parent ac1803fc00
commit 93c5d8ca6d
2 changed files with 20 additions and 6 deletions

View file

@ -25,7 +25,7 @@ needs_commands() { # $cmd1 $cmd2 ...
return 0 return 0
} }
needs_commands "xidel" needs_commands "xidel" "curl" || exit 1
echo -n "Downloading citrix update page ... " >&2 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')" html_data="$(curl -sSfL 'https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html')"
@ -188,7 +188,7 @@ download_gui() { # $link $csum $destfile
} }
install_deb() { # $name install_deb() { # $name
needs_commands "dpkg-query" "gdebi-gtk" || return 1 needs_commands "dpkg-query" "zenity" "gdebi-gtk" || return 1
local arch local arch
arch="$(uname -m)" arch="$(uname -m)"
@ -211,9 +211,15 @@ install_deb() { # $name
version_available="$(echo "${link}" | sed -r 's/^.*\/[^_]+_([[:digit:]\.]+)_[^\.]+\.deb.*$/\1/')" version_available="$(echo "${link}" | sed -r 's/^.*\/[^_]+_([[:digit:]\.]+)_[^\.]+\.deb.*$/\1/')"
local version_installed 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 && [ "${version_available}" = "${version_installed}" ]; then
echo "Newest version already installed!" >&2 echo "Newest version already installed!" >&2
zenity \
--notification \
--window-icon="info" \
--text="Citrix \"${1}\": Newest version is installed!"
sleep 2
return 0 return 0
fi fi

View file

@ -1,5 +1,13 @@
#!/bin/sh #!/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() { _include_bindir_in_path() {
if [ -d "${1}" ]; then if [ -d "${1}" ]; then
real_bin_dir="$(readlink -f "${1}" )" real_bin_dir="$(readlink -f "${1}" )"