forked from travis-ci/packer-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup
More file actions
executable file
·41 lines (34 loc) · 886 Bytes
/
Copy pathcleanup
File metadata and controls
executable file
·41 lines (34 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
set -o errexit
set -o xtrace
shopt -s nullglob
# clear the APT cache and delete everything from /var/cache/apt/archives/
apt clean
rm -rf \
/etc/apparmor* \
/etc/profile.d/jdk.csh \
/etc/profile.d/jdk.sh \
/etc/ssh/ssh_host_* \
/lib/recovery-mode \
/opt/chef* \
/tmp/* \
/usr/lib/jvm/.java-8-oracle-amd64.jinfo \
/usr/lib/jvm/default-java \
/usr/lib/jvm/java-8-oracle-amd64 \
/var/chef \
/var/log/installer \
/var/tmp/* \
VBoxGuestAdditions_*.iso \
VBoxGuestAdditions_*.iso.?
if [[ $CLEANUP_APT_LISTS ]]; then
rm -rf /var/lib/apt/lists/* || echo "Suppressing exit $?"
fi
if [[ $CLEANUP_MAN_DB ]]; then
rm -rf /var/lib/man-db || echo "Suppressing exit $?"
fi
if [[ -d /home/travis ]]; then
rm -f /home/travis/linux.iso /home/travis/shutdown.sh
fi
find /var/log -type f | while read -r f; do
dd if=/dev/null of="${f}"
done