mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-04 01:38:12 +08:00
Update install_pve.sh
This commit is contained in:
parent
01b1534238
commit
ef8f4499ef
1 changed files with 10 additions and 14 deletions
|
@ -110,20 +110,16 @@ fi
|
|||
rebuild_cloud_init
|
||||
|
||||
# 检测IPV4
|
||||
check_ipv4(){
|
||||
API_NET=("ip.sb" "ipget.net" "ip.ping0.cc" "https://ip4.seeip.org" "https://api.my-ip.io/ip" "https://ipv4.icanhazip.com" "api.ipify.org")
|
||||
for p in "${API_NET[@]}"; do
|
||||
response=$(curl -s4m6 "$p")
|
||||
API_NET=("ip.sb" "ipget.net" "ip.ping0.cc" "https://ip4.seeip.org" "https://api.my-ip.io/ip" "https://ipv4.icanhazip.com" "api.ipify.org")
|
||||
for p in "${API_NET[@]}"; do
|
||||
response=$(curl -s4m8 "$p")
|
||||
sleep 1
|
||||
if [ $? -eq 0 ] && ! echo "$response" | grep -q "error"; then
|
||||
IP_API="$p"
|
||||
ip=$(curl -s4m6 "$IP_API")
|
||||
break
|
||||
fi
|
||||
done
|
||||
export ip
|
||||
}
|
||||
check_ipv4
|
||||
done
|
||||
ip=$(curl -s4m6 "$IP_API")
|
||||
|
||||
# /etc/hosts文件修改
|
||||
hostname=$(hostname)
|
||||
|
|
Loading…
Reference in a new issue