summaryrefslogtreecommitdiff
path: root/tests/scripts/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/common.sh')
-rw-r--r--tests/scripts/common.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 8e82660155..3cf841c25b 100644
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -19,11 +19,9 @@
# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# due to the use of $RANDOM, this script requires bash
-
export TZ="UTC"
-GETPORT='rc=0;while test $rc = 0;do PORT="$(((($$<<15)|RANDOM) % 63001 + 2000))";
+GETPORT='rc=0;myrandom=$(date +%N | sed 's/^0*//');while test $rc = 0;do PORT="$(((($$<<15)|$myrandom) % 63001 + 2000))";
netstat -anl|grep "[\:\.]$PORT" >/dev/null 2>&1;
rc=$?;done;'