dig instead of ping + efficiency
This commit is contained in:
parent
b08d72152b
commit
874f32a33f
@ -3,7 +3,7 @@
|
|||||||
CONFIG=/etc/nginx/sites-enabled/$1
|
CONFIG=/etc/nginx/sites-enabled/$1
|
||||||
DOMAIN=$2
|
DOMAIN=$2
|
||||||
|
|
||||||
IP=$(ping -c 1 $DOMAIN | awk '{print $3}' | head -n 1 | sed 's\(\\' | sed 's\)\\')
|
IP=$(dig $DOMAIN +short)
|
||||||
IP_OLD=$(grep -A0 '#DYNAMIC' $CONFIG | awk '{print $2}' | cut -f1 -d ';')
|
IP_OLD=$(grep -A0 '#DYNAMIC' $CONFIG | awk '{print $2}' | cut -f1 -d ';')
|
||||||
|
|
||||||
if [ "$IP" != "$IP_OLD" ]
|
if [ "$IP" != "$IP_OLD" ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user