local cleaned_old_repo="n"
local logfile=
local cmd=
+ local f
empty_oracle_repo_files || true
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
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