mirror of
https://github.com/thelittlerocket/pve.git
synced 2024-11-15 11:38:00 +08:00
Update buildvm_extraip.sh
This commit is contained in:
parent
ee6247b8ee
commit
3887cb1e3e
1 changed files with 4 additions and 0 deletions
|
@ -105,6 +105,10 @@ if ! command -v ping > /dev/null 2>&1; then
|
|||
fi
|
||||
interface=$(lshw -C network | awk '/logical name:/{print $3}' | head -1)
|
||||
user_main_ip_range=$(grep -A 1 "iface ${interface}" /etc/network/interfaces | grep "address" | awk '{print $2}')
|
||||
if [ -z "$user_main_ip_range" ]; then
|
||||
echo "宿主机可用IP区间查询失败"
|
||||
exit 1
|
||||
fi
|
||||
# 宿主机IP
|
||||
user_main_ip=$(echo "$user_main_ip_range" | cut -d'/' -f1)
|
||||
user_ip_range=$(echo "$user_main_ip_range" | cut -d'/' -f2)
|
||||
|
|
Loading…
Reference in a new issue