refractoring
This commit is contained in:
18
modules/ip
18
modules/ip
@ -1,6 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
IP=$(curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
|
||||
if [[ -n "$BLOCK_INSTANCE" ]]; then
|
||||
IF="$BLOCK_INSTANCE"
|
||||
else
|
||||
IF=$(ip route | awk '/^default/ { print $5 ; exit }')
|
||||
fi
|
||||
|
||||
if [[ ! -d "/sys/class/net/$IF" ]]; then
|
||||
echo " no network interface "
|
||||
echo "not found"
|
||||
echo ""
|
||||
exit 33
|
||||
fi
|
||||
|
||||
echo $IF
|
||||
|
||||
WAN_IP=$(curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
|
||||
LAN_IP=$(ip addr | gawk '/
|
||||
|
||||
echo "$IP"
|
||||
echo "$IP"
|
||||
|
Reference in New Issue
Block a user