mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
core: 放置 cloud-init 配置时,删除注释
This commit is contained in:
parent
5252f1e581
commit
250a7e26de
@ -20,7 +20,6 @@ runcmd:
|
||||
# opensuse tumbleweed 有 /etc/ssh/sshd_config.d/ 文件夹,但没有 /etc/ssh/sshd_config,但有/usr/etc/ssh/sshd_config
|
||||
- grep 'Include.*/etc/ssh/sshd_config.d' /etc/sshd_config && echo "PermitRootLogin yes" >/etc/ssh/sshd_config.d/01-permitrootlogin.conf || echo "PermitRootLogin yes" >>/etc/ssh/sshd_config
|
||||
- systemctl restart sshd
|
||||
# ubuntu 镜像运行 echo -e '\nDone' ,-e 会被显示出来
|
||||
- echo >/dev/tty0
|
||||
- echo Done >/dev/tty0
|
||||
- touch /etc/cloud/cloud-init.disabled
|
||||
# ubuntu 镜像运行 echo -e '\nDone' ,-e 会被显示出来
|
||||
- printf '\n%s\n' 'done' >/dev/console
|
7
trans.sh
7
trans.sh
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user