mirror of
https://github.com/thelittlerocket/pve.git
synced 2024-11-15 11:38:00 +08:00
Update install_pve.sh
This commit is contained in:
parent
a0ee033f40
commit
86e181d7ca
1 changed files with 9 additions and 3 deletions
|
@ -77,7 +77,7 @@ check_cdn_file() {
|
|||
cdn_urls=("https://cdn.spiritlhl.workers.dev/" "https://cdn3.spiritlhl.net/" "https://cdn1.spiritlhl.net/" "https://ghproxy.com/" "https://cdn2.spiritlhl.net/")
|
||||
check_cdn_file
|
||||
|
||||
# /etc/hosts文件修改
|
||||
# cloud-init文件修改
|
||||
if [ -f "/etc/cloud/cloud.cfg" ]; then
|
||||
chattr -i /etc/cloud/cloud.cfg
|
||||
if grep -q "preserve_hostname: true" "/etc/cloud/cloud.cfg"; then
|
||||
|
@ -86,10 +86,16 @@ if [ -f "/etc/cloud/cloud.cfg" ]; then
|
|||
sed -E -i 's/preserve_hostname:[[:space:]]*false/preserve_hostname: true/g' "/etc/cloud/cloud.cfg"
|
||||
echo "change preserve_hostname to true"
|
||||
fi
|
||||
if grep -q "disable_root: false" "/etc/cloud/cloud.cfg"; then
|
||||
:
|
||||
else
|
||||
sed -E -i 's/disable_root:[[:space:]]*true/disable_root: false/g' "/etc/cloud/cloud.cfg"
|
||||
echo "change disable_root to false"
|
||||
fi
|
||||
chattr +i /etc/cloud/cloud.cfg
|
||||
else
|
||||
echo "can not find /etc/cloud/cloud.cfg"
|
||||
fi
|
||||
|
||||
# /etc/hosts文件修改
|
||||
ip=$(curl -s ipv4.ip.sb)
|
||||
hostname=$(hostname)
|
||||
if [ "${hostname}" != "pve" ]; then
|
||||
|
|
Loading…
Reference in a new issue