feat: Check network interface
* feat: Check network interface
This commit is contained in:
parent
886012699a
commit
218cd8d5ad
1 changed files with 8 additions and 3 deletions
|
@ -211,6 +211,11 @@ fi
|
||||||
update-alternatives --set iptables /usr/sbin/iptables-legacy > /dev/null
|
update-alternatives --set iptables /usr/sbin/iptables-legacy > /dev/null
|
||||||
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null
|
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null
|
||||||
|
|
||||||
|
if [ ! -d "/sys/class/net/$VM_NET_DEV" ]; then
|
||||||
|
error "Network interface $VM_NET_DEV does not exist inside the container!"
|
||||||
|
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 27
|
||||||
|
fi
|
||||||
|
|
||||||
VM_NET_MAC="${VM_NET_MAC//-/:}"
|
VM_NET_MAC="${VM_NET_MAC//-/:}"
|
||||||
GATEWAY=$(ip r | grep default | awk '{print $3}')
|
GATEWAY=$(ip r | grep default | awk '{print $3}')
|
||||||
IP=$(ip address show dev "$VM_NET_DEV" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
IP=$(ip address show dev "$VM_NET_DEV" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
||||||
|
|
Loading…
Reference in a new issue