cleanup.sh 445 Bytes
Newer Older
1
2
#!/bin/bash -eux

3
4
# Cleaning up leftover dhcp leases
rm -f /var/lib/dhcp3/* /var/lib/dhcp/*
5
6
7
8
9
10
11
12
13
14

rm -rf /tmp/*

# Cleanup apt cache
apt-get -y autoremove --purge
apt-get -y clean
apt-get -y autoclean

unset HISTFILE
rm -f /root/.bash_history
15
rm -f /home/ubuntu/.bash_history
16
17
18
19

# Clean up log files
find /var/log -type f | while read f; do echo -ne '' > "${f}"; done;

20
# Clearing last login information
21
22
23
>/var/log/lastlog
>/var/log/wtmp
>/var/log/btmp