mirror of
https://github.com/thelittlerocket/pve.git
synced 2024-11-15 19:44:38 +08:00
Update install_pve.sh
This commit is contained in:
parent
c43cc008d5
commit
48c8dfc66c
1 changed files with 10 additions and 0 deletions
|
@ -93,6 +93,16 @@ if [ -f "/etc/cloud/cloud.cfg" ]; then
|
||||||
sed -E -i 's/disable_root:[[:space:]]*true/disable_root: false/g' "/etc/cloud/cloud.cfg"
|
sed -E -i 's/disable_root:[[:space:]]*true/disable_root: false/g' "/etc/cloud/cloud.cfg"
|
||||||
echo "change disable_root to false"
|
echo "change disable_root to false"
|
||||||
fi
|
fi
|
||||||
|
chattr -i /etc/cloud/cloud.cfg
|
||||||
|
content=$(cat /etc/cloud/cloud.cfg)
|
||||||
|
line_number=$(grep -n "^system_info:" "$file" | cut -d ':' -f 1)
|
||||||
|
if [ -n "$line_number" ]; then
|
||||||
|
lines_after_system_info=$(echo "$content" | sed -n "$((line_number+1)),\$p")
|
||||||
|
if [ -n "$lines_after_system_info" ]; then
|
||||||
|
updated_content=$(echo "$content" | sed "$((line_number+1)),\$d")
|
||||||
|
echo "$updated_content" > "$file"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
chattr +i /etc/cloud/cloud.cfg
|
chattr +i /etc/cloud/cloud.cfg
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue