From 58841b42a763e223e249655ea4f97b1c7345c7f4 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 22 Feb 2023 11:43:15 -0500 Subject: [PATCH] Update app-server.sh Support earlier node 14s by doing a flag compatibility check on dns-result-order Signed-off-by: 1000TurquoisePogs --- bin/app-server.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/app-server.sh b/bin/app-server.sh index 9482b88..eccb81f 100755 --- a/bin/app-server.sh +++ b/bin/app-server.sh @@ -91,11 +91,18 @@ else ZLUX_SERVER_FILE=zluxServer.js fi +# Tells node whether to prefer ipv4 or ipv6 results to DNS lookups ZLUX_DNS_ORDER="--dns-result-order=ipv4first" if [ "$ZWE_components_app_server_dns_lookupOrder" = "ipv6" ]; then ZLUX_DNS_ORDER="--dns-result-order=verbatim" fi +# not all versions of node support the above (14.18+ generally) so we can just try it to see what happens. +v4_check=$(${NODE_BIN} ${ZLUX_DNS_ORDER} -e "console.log('success');") +if [ "${v4_check}" != "success" ]; then + ZLUX_DNS_ORDER= +fi + if [ -z "$ZLUX_NO_LOGFILE" ]; then __UNTAGGED_READ_MODE=V6 \ _BPX_JOBNAME=${ZOWE_PREFIX}DS \