Skip to content

Commit 4069b6c

Browse files
author
MMA
committed
support for indiviudal ports
1 parent 5321758 commit 4069b6c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

check_kubernetes.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ mode_apicert() {
156156
die "Apiserver URL should be defined in this mode"
157157
fi
158158
APICERT=$(echo "$APISERVER" | awk -F "//" '{ print $2 }' | awk -F ":" '{ print $1 }')
159-
APICERTDATE=$(echo | openssl s_client -connect "$APICERT":6443 2>/dev/null | openssl x509 -noout -dates | grep notAfter | sed -e 's#notAfter=##')
159+
APIPORT=$(echo "$APISERVER" | awk -F "//" '{ print $2 }' | awk -F ":" '{ print $2 }')
160+
set ${APIPORT:=443}
161+
APICERTDATE=$(echo | openssl s_client -connect "$APICERT":"$APIPORT" 2>/dev/null | openssl x509 -noout -dates | grep notAfter | sed -e 's#notAfter=##')
160162
a=$(date -d "$APICERTDATE" +%s)
161163
b=$(date +%s)
162164
c=$((a-b))

0 commit comments

Comments
 (0)