[[ ! $foundIp && ! $isLAN ]]

This commit is contained in:
qo-op 2020-12-08 03:36:10 +01:00
parent b364682ca3
commit 11569b5d8a
1 changed files with 3 additions and 2 deletions

View File

@ -45,9 +45,10 @@ do
timestamp=$(date -u +%s%N | cut -b1-13)
echo "$nowdate - $id - $ip"
foundIp=$(cat ~/.zen/A_allow_ip.txt | grep "$ip" | wc -l)
foundIp=$(cat ~/.zen/A_allow_ip.txt | grep "$ip")
isLAN=$(echo $ip | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
if [ "$foundIp" -eq 0 ] ; then
if [[ ! $foundIp && ! $isLAN ]] ; then
echo "${ip} of peer ${id} is not in the authorized ip list."
echo "${peer} will be removed from the swarm"