From 93c5d8ca6d5b98386175ccc46cc6b8467b11bef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 30 Oct 2025 14:58:34 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20various=20small=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/citrix-update | 18 ++++++++++++------ conf/profile | 8 ++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/bin/citrix-update b/bin/citrix-update index ccebff8..dc39bdd 100755 --- a/bin/citrix-update +++ b/bin/citrix-update @@ -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 diff --git a/conf/profile b/conf/profile index 655c810..432879a 100644 --- a/conf/profile +++ b/conf/profile @@ -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}" )"