diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2019-10-28 18:24:40 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2019-10-28 18:24:40 +0100 |
commit | 2df6c231a41cae525f77a46e98ddf805f667ce5b (patch) | |
tree | 320b7739c47f3cb761d64c77774ab328fe096f38 /lib/adei/adei.sh | |
parent | f4aeada37b662e2ff7bfc00eabeec06e6a7e3768 (diff) | |
download | conky-2df6c231a41cae525f77a46e98ddf805f667ce5b.tar.gz conky-2df6c231a41cae525f77a46e98ddf805f667ce5b.tar.bz2 conky-2df6c231a41cae525f77a46e98ddf805f667ce5b.tar.xz conky-2df6c231a41cae525f77a46e98ddf805f667ce5b.zip |
Fix error reporting on ADEI host unreachable
Diffstat (limited to 'lib/adei/adei.sh')
-rw-r--r-- | lib/adei/adei.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/adei/adei.sh b/lib/adei/adei.sh index 3a0aeb6..8519af7 100644 --- a/lib/adei/adei.sh +++ b/lib/adei/adei.sh @@ -222,6 +222,10 @@ function adei_init_ { port=":${hopo[1]:-80}" [ $port = ":80" ] && port="" + # Preliminary for the sake of error reporting + adei_host="$host" + adei_port="$port" + local fqdn if [ -z "$url" ]; then url=$(adei_resolve_id "setup/adei.txt" "$id" "$host" "$setup") @@ -243,17 +247,15 @@ function adei_init_ { adei_auth=$(adei_resolve_id "security/adei.txt" "$id" "$host" "$setup") [ -n "$adei_auth" ] && adei_auth="$adei_auth@" - # Now check port - adei_online=$(scripts/ping.pl "$host" "$port") - [ $adei_online -ne 1 ] && return 2 - # Now build ADEI url - adei_setup="$setup" adei_host="$host" adei_port="$port" adei_url="${url#http*://}/services" + # Now check port + adei_online=$(scripts/ping.pl "$host" "$port") + [ $adei_online -ne 1 ] && return 2 adei_query_version; local err=$? [ $err -gt 0 ] && return $err |