diff --git a/bash/cfScanner.sh b/bash/cfScanner.sh index a385bc64..b4a2499d 100755 --- a/bash/cfScanner.sh +++ b/bash/cfScanner.sh @@ -100,8 +100,18 @@ fncSubnetToIP() { done done # Choose random IP addresses from generated IP list - mapfile -t ipList < <(shuf -e "${ipList[@]}") - mapfile -t ipList < <(shuf -e "${ipList[@]:0:$randomNumber}") + if [[ "$osVersion" == "Linux" ]] + then + mapfile -t ipList < <(shuf -e "${ipList[@]}") + mapfile -t ipList < <(shuf -e "${ipList[@]:0:$randomNumber}") + elif [[ "$osVersion" == "Mac" ]] + then + ipList=($(printf '%s\n' "${ipList[@]}" | shuf)) + ipList=($(printf '%s\n' "${ipList[@]:0:$randomNumber}" | shuf)) + else + echo "OS not supported only Linux or Mac" + exit 1 + fi for i in "${ipList[@]}"; do echo "$i" done @@ -212,7 +222,16 @@ function fncCheckIPList { if [[ "$domainFronting" == "200" ]] then mainDomain=$(echo "$configHost" | awk -F '.' '{ print $2"."$3}') - randomUUID=$(cat /proc/sys/kernel/random/uuid) + if [[ "$osVersion" == "Linux" ]] + then + randomUUID=$(cat /proc/sys/kernel/random/uuid) + elif [[ "$osVersion" == "Mac" ]] + then + randomUUID=$(uuidgen | tr '[:upper:]' '[:lower:]') + else + echo "OS not supported only Linux or Mac" + exit 1 + fi configServerName="$randomUUID.$mainDomain" ipConfigFile="$tempConfigDir/config.json.$ip" cp "$scriptDir"/config.json.temp "$ipConfigFile"