From 180905ecba43d2e8b29240fd00052b4a4054e073 Mon Sep 17 00:00:00 2001 From: JimChenWYU Date: Tue, 24 Sep 2024 15:09:31 +0800 Subject: [PATCH] POSIX Shell --- scripts/probe.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/probe.sh b/scripts/probe.sh index c85de2f8..150ca636 100644 --- a/scripts/probe.sh +++ b/scripts/probe.sh @@ -1,11 +1,14 @@ -#!/bin/bash +#!/bin/sh + +# Please use POSIX Shell +# https://www.grymoire.com/Unix/Sh.html IP=127.0.0.1 PORT=9000 while true; do nc -zv ${IP} ${PORT} - if [[ "$?" == "0" ]]; then + if [ "$?" == "0" ]; then exit 0 fi sleep 2