Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 1 | #!/bin/bash -xe |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 2 | |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 3 | apt-get -y autoremove --purge |
| 4 | apt-get -y clean |
| 5 | rm -rf /var/lib/apt/lists/* |
| 6 | |
| 7 | rm -f /usr/sbin/policy-rc.d || true |
| 8 | |
| 9 | echo "cleaning up hostname" |
azvyagintsev | c86fbaf | 2018-03-02 18:57:03 +0200 | [diff] [blame] | 10 | sed -i "/.*ubuntu.*/d" /etc/hosts |
| 11 | sed -i "/.*salt.*/d" /etc/hosts |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 12 | |
| 13 | echo "cleaning up guest additions" |
| 14 | rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.? || true |
| 15 | |
| 16 | echo "cleaning up dhcp leases" |
| 17 | rm -rf /var/lib/dhcp/* || true |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame] | 18 | rm -rf /var/lib/ntp/ntp.conf.dhcp || true |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 19 | |
| 20 | echo "cleaning up udev rules" |
| 21 | rm -f /etc/udev/rules.d/70-persistent-net.rules || true |
| 22 | rm -rf /dev/.udev/ || true |
| 23 | rm -f /lib/udev/rules.d/75-persistent-net-generator.rules || true |
| 24 | |
| 25 | echo "cleaning up minion_id for salt" |
| 26 | rm -f /etc/salt/minion_id || true |
| 27 | |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 28 | echo "cleaning up resolvconf" |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 29 | sed -i '/172\.18\.208\.44/d' /etc/resolvconf/resolv.conf.d/base |
| 30 | |
| 31 | # Clear\drop cache's |
| 32 | sync |
| 33 | echo 3 > /proc/sys/vm/drop_caches |