From: Frank Brehm Date: Fri, 27 Sep 2024 09:47:38 +0000 (+0200) Subject: Fixing postinstall-scripts/update-all-packages X-Git-Tag: 1.11.5^2~1 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=b1d861663bf99854030f62ed80d28a9bb005a8e2;p=pixelpark%2Fcreate-terraform.git Fixing postinstall-scripts/update-all-packages --- diff --git a/postinstall-scripts/update-all-packages b/postinstall-scripts/update-all-packages index 7012c1e..1be2fc3 100755 --- a/postinstall-scripts/update-all-packages +++ b/postinstall-scripts/update-all-packages @@ -148,6 +148,7 @@ do_el_upgrade() { local cleaned_old_repo="n" local logfile= local cmd= + local f empty_oracle_repo_files || true @@ -202,8 +203,11 @@ do_el_upgrade() { RM_force "${awk_script}" fi - cmd="sed -i -e '/tsflags *=/d' \"${YUM_CONF}\"" - exec_cmd ${cmd} + if grep -P '^\s*tsflags\s*=' "${YUM_CONF}" >/dev/null ; then + info "Removing transition flags from '${CYAN}${YUM_CONF}${NORMAL}': $( grep -P '^\s*tsflags\s*=' "${YUM_CONF}" )" + cmd="sed -i -e '/tsflags *=/d' \"${YUM_CONF}\"" + exec_cmd ${cmd} + fi if [[ "${VERBOSE}" == "y" ]] ; then empty_line @@ -237,9 +241,15 @@ do_el_upgrade() { else exec_cmd ${tool} --assumeyes erase cloud-init fi - RM -rf /etc/sysconfig/network-scripts/* /etc/sysconfig/network-scripts/.* /home/cloud-user sleep 1 fi + empty_line + for f in /etc/sysconfig/network-scripts/ifcfg* /home/cloud-user ; do + if [[ ! -e "${f}" ]] ; then + continue + fi + RM -rf "${f}" + done for logfile in /var/log/cloud-init.log /var/log/cloud-init-output.log ; do if [[ ! -f "${logfile}}" ]] ; then