core: 放置 cloud-init 配置时,删除注释

This commit is contained in:
bin456789
2023-10-22 00:46:53 +08:00
parent 5252f1e581
commit 250a7e26de
2 changed files with 6 additions and 6 deletions

View File

@ -747,10 +747,11 @@ EOF
download_cloud_init_config() {
os_dir=$1
ci_file=$os_dir/etc/cloud/cloud.cfg.d/99_nocloud.cfg
# shellcheck disable=SC2154
download $confhome/nocloud.yaml $ci_file
ci_file=$os_dir/etc/cloud/cloud.cfg.d/99_nocloud.cfg
download $confhome/cloud-init.yaml $ci_file
# 删除注释行,除了第一行
sed -i '1!{/^[[:space:]]*#/d}' $ci_file
# swapfile
# 如果分区表中已经有swapfile就跳过例如arch