git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Pfeiffer <coding _ lirion.de> 2020-08-03 12:42:57 +0200
committerHarald Pfeiffer <coding _ lirion.de> 2020-08-03 12:42:57 +0200
commit160302a97bf721069174363c8b07582d70ebfa14 (patch)
tree4f77ced25501709d0bf34093016bc30f69e1cbfd
parentd5980195f855cf49e981cafa78a8c086391a7f4e (diff)
downloadlinux-scripts-160302a97bf721069174363c8b07582d70ebfa14.tar.bz2
Define SVCNM anyway independent of the port reachability success
-rwxr-xr-xbin/sslcheck10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/sslcheck b/bin/sslcheck
index 7fdfdfe..26b72c0 100755
--- a/bin/sslcheck
+++ b/bin/sslcheck
@@ -69,13 +69,13 @@ case "$TGTPORT" in
5432) sslinitparms+=( "-starttls" "postgres" );;
esac
+if [ -z "$TGTPORTN" ]; then
+ SVCNM="$(grep -P "[\\t\\ ]$TGTPORT/tcp" /etc/services|awk '{print $1}')"
+else
+ SVCNM="$TGTPORTN"
+fi
if ! nc -zw3 "$TGTURL" "$TGTPORT"; then
printf "%b cannot be reached on port %b" "$TGTURL" "$TGTPORT" >&2
- if [ -z "$TGTPORTN" ]; then
- SVCNM="$(grep -P "[\\t\\ ]$TGTPORT/tcp" /etc/services|awk '{print $1}')"
- else
- SVCNM="$TGTPORTN"
- fi
if [ -n "$SVCNM" ];then
printf " (%b).\n" "$SVCNM" >&2
else