Skip to content

Commit

Permalink
linux-common/cleanup.sh changed to pass shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Dec 8, 2019
1 parent 6505219 commit 742d334
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/linux-common/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 742d334

Please sign in to comment.