summaryrefslogtreecommitdiffstats
path: root/lib/adei
diff options
context:
space:
mode:
Diffstat (limited to 'lib/adei')
-rw-r--r--lib/adei/adei.sh12
-rw-r--r--lib/adei/adei_error.sh2
2 files changed, 8 insertions, 6 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
diff --git a/lib/adei/adei_error.sh b/lib/adei/adei_error.sh
index 9de4795..63657fe 100644
--- a/lib/adei/adei_error.sh
+++ b/lib/adei/adei_error.sh
@@ -27,7 +27,7 @@ function adei_print_error {
msg="Error communicating with $service"
ret=1
elif [ $code -eq 2 ]; then
- msg="ADEI host ($adei_host:$adei_port) unreachable"
+ msg="ADEI host ($adei_host:${adei_port:-80}) unreachable"
elif [ $code -eq 3 ]; then
msg="Timeout waiting for $service"
elif [ $code -eq 4 ]; then