]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Removing logfiles of cloud-init.
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Nov 2023 13:35:05 +0000 (14:35 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Nov 2023 13:35:05 +0000 (14:35 +0100)
postinstall-scripts/update-all-packages

index 1819baa29d6790baf29e831dfefa02f71bbafae0..d4a9477c2bc158fe2241fd8fb8bfba7cea00e738 100755 (executable)
@@ -146,6 +146,7 @@ do_el_upgrade() {
     local found_ip_resolv="n"
     local awk_script=''
     local cleaned_old_repo="n"
+    local logfile=
 
     empty_oracle_repo_files || true
 
@@ -198,6 +199,14 @@ ok==1 {print "ip_resolve=4"; ok=0}
         exec_cmd ${tool}  --assumeyes erase cloud-init
     fi
 
+    for logfile in /var/log/cloud-init.log /var/log/cloud-init-output.log ; do
+        if [[ ! -f "${logfile}}" ]] ; then
+            continue
+        fi
+        info "Removing '${CYAN}${logfile}${NORMAL}' ..."
+        RM "${logfile}}"
+    done
+
     echo
     info "Doing upgrade ..."
     exec_cmd ${tool} --assumeyes upgrade