mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-03 17:27:17 +08:00
Update install_pve.sh
This commit is contained in:
parent
9e6d4df3af
commit
bf501e2ed8
1 changed files with 10 additions and 10 deletions
|
@ -78,6 +78,16 @@ cdn_urls=("https://cdn.spiritlhl.workers.dev/" "https://shrill-pond-3e81.hunsh.w
|
|||
check_cdn_file
|
||||
|
||||
# /etc/hosts文件修改
|
||||
if [ -f "/etc/cloud/cloud.cfg" ]; then
|
||||
if grep -q "preserve_hostname: false" "/etc/cloud/cloud.cfg"; then
|
||||
sed -i 's/preserve_hostname: false/preserve_hostname: true/g' "/etc/cloud/cloud.cfg"
|
||||
echo "change preserve_hostname to true"
|
||||
else
|
||||
echo "preserve_hostname is true"
|
||||
fi
|
||||
else
|
||||
echo "can not find /etc/cloud/cloud.cfg"
|
||||
fi
|
||||
ip=$(curl -s ipv4.ip.sb)
|
||||
hostname=$(hostname)
|
||||
if [ "${hostname}" != "pve" ]; then
|
||||
|
@ -113,16 +123,6 @@ if [ "${hostname}" != "pve" ]; then
|
|||
# fi
|
||||
chattr +i /etc/hosts
|
||||
fi
|
||||
if [ -f "/etc/cloud/cloud.cfg" ]; then
|
||||
if grep -q "preserve_hostname: false" "/etc/cloud/cloud.cfg"; then
|
||||
sed -i 's/preserve_hostname: false/preserve_hostname: true/g' "/etc/cloud/cloud.cfg"
|
||||
echo "change preserve_hostname to true"
|
||||
else
|
||||
echo "preserve_hostname is true"
|
||||
fi
|
||||
else
|
||||
echo "can not find /etc/cloud/cloud.cfg"
|
||||
fi
|
||||
|
||||
## ChinaIP检测
|
||||
if [[ -z "${CN}" ]]; then
|
||||
|
|
Loading…
Reference in a new issue