include cygwin and msys2 ostypes to oscp-stapling tests

This commit is contained in:
Ruby Martin
2025-01-29 14:05:58 -07:00
parent 57646a88ff
commit 6fed2fe447
2 changed files with 4 additions and 4 deletions

View File

@ -448,12 +448,11 @@ generate_port() {
# Generate a random port number
#-------------------------------------------------------------------------#
if [[ "$OSTYPE" == "linux"* ]]; then
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys"
|| "$OSTYPE" == "cygwin"* ]]; then
port=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "darwin"* ]]; then
port=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "msys" ]]; then
port=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))
else
echo "Unknown OS TYPE"
exit 1

View File

@ -467,7 +467,8 @@ generate_port() {
# Generate a random port number
#-------------------------------------------------------------------------#
if [[ "$OSTYPE" == "linux"* ]]; then
if [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "msys"
|| "$OSTYPE" == "cygwin" ]]; then
port=$(($(od -An -N2 /dev/urandom) % (65535-49512) + 49512))
elif [[ "$OSTYPE" == "darwin"* ]]; then
port=$(($(od -An -N2 /dev/random) % (65535-49512) + 49512))