| #!/bin/bash -xe |
| #apt-get purge salt-formula-* -y |
| apt-get -y autoremove --purge |
| apt-get -y clean |
| #rm -rf /var/lib/apt/lists/* |
| #rm -rf /etc/apt/sources.list.d/* |
| #echo "" > /etc/apt/sources.list |
| #rm -rf '/srv/salt/reclass/classes/!(service)' |
| chmod +x /var/lib/maas/.maas_login.sh |
| rm -f /usr/sbin/policy-rc.d || true |
| |
| echo "cleaning up hostname" |
| sed -i "/.*ubuntu.*/d" /etc/hosts |
| sed -i "/.*salt.*/d" /etc/hosts |
| |
| echo "cleaning up guest additions" |
| rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.? || true |
| |
| echo "cleaning up dhcp leases" |
| rm -rf /var/lib/dhcp/* || true |
| |
| echo "cleaning up udev rules" |
| rm -f /etc/udev/rules.d/70-persistent-net.rules || true |
| rm -rf /dev/.udev/ || true |
| rm -f /lib/udev/rules.d/75-persistent-net-generator.rules || true |
| |
| echo "cleaning up minion_id for salt" |
| rm -f /etc/salt/minion_id || true |
| |
| echo "cleaning up resolvconf" |
| sed -i '/172\.18\.208\.44/d' /etc/resolvconf/resolv.conf.d/base |
| |
| # Clear\drop cache's |
| sync |
| echo 3 > /proc/sys/vm/drop_caches |