[[ ! $foundIp && ! $isLAN ]]
This commit is contained in:
parent
b364682ca3
commit
11569b5d8a
|
@ -45,9 +45,10 @@ do
|
||||||
timestamp=$(date -u +%s%N | cut -b1-13)
|
timestamp=$(date -u +%s%N | cut -b1-13)
|
||||||
|
|
||||||
echo "$nowdate - $id - $ip"
|
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 "${ip} of peer ${id} is not in the authorized ip list."
|
||||||
echo "${peer} will be removed from the swarm"
|
echo "${peer} will be removed from the swarm"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue