From 742d334a9c9d3d09199ceeb687362c5e3e3c1863 Mon Sep 17 00:00:00 2001 From: Petr Ruzicka Date: Sun, 8 Dec 2019 15:02:55 +0100 Subject: [PATCH] linux-common/cleanup.sh changed to pass shellcheck --- scripts/linux-common/cleanup.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/linux-common/cleanup.sh b/scripts/linux-common/cleanup.sh index e9c00c81..1da1e5f7 100644 --- a/scripts/linux-common/cleanup.sh +++ b/scripts/linux-common/cleanup.sh @@ -51,15 +51,15 @@ rm -rf /tmp/* # Remove Bash history unset HISTFILE rm -f /root/.bash_history -rm -f /home/${SSH_USER}/.bash_history +rm -f "/home/${SSH_USER}/.bash_history" # Clean up log files -find /var/log -type f | while read f; do echo -ne '' > $f; done; +find /var/log -type f | while read -r f; do echo -ne '' > "$f"; done; echo "==> Clearing last login information" ->/var/log/lastlog ->/var/log/wtmp ->/var/log/btmp +true >/var/log/lastlog +true >/var/log/wtmp +true >/var/log/btmp # Zero out the free space to save space in the final image dd if=/dev/zero of=/EMPTY_FILE bs=1M &> /dev/null || echo "dd exit code $? is suppressed"