Update build_nat_network.sh

This commit is contained in:
spiritlhl 2023-06-03 14:28:59 +08:00 committed by GitHub
parent 790f963344
commit ff4f2f34db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,7 @@ fi
IPV4=$(ip -4 addr show | grep global | awk '{print $2}' | cut -d '/' -f1 | head -n 1) IPV4=$(ip -4 addr show | grep global | awk '{print $2}' | cut -d '/' -f1 | head -n 1)
# 查询信息 # 查询信息
apt-get install lshw -y
interface=$(lshw -C network | awk '/logical name:/{print $3}' | head -1) interface=$(lshw -C network | awk '/logical name:/{print $3}' | head -1)
if [ -z "$interface" ]; then if [ -z "$interface" ]; then
interface="eth0" interface="eth0"