blob: 919f64ac5331b795a967b70569f1fc4bf91ab45d [file] [log] [blame]
#!/bin/bash -xe
apt-get -y autoremove --purge
apt-get -y clean
rm -rf /var/lib/apt/lists/*
rm -rv /etc/apt/sources.list.d/* || true
echo > /etc/apt/sources.list || true
rm -vf /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
rm -rfv /var/lib/ntp/ntp.conf.dhcp || true
echo "cleaning up udev rules"
rm -fv /etc/udev/rules.d/70-persistent-net.rules || true
rm -rf /dev/.udev/ || true
rm -fv /lib/udev/rules.d/75-persistent-net-generator.rules || true
echo "cleaning up minion_id for salt"
rm -vf /etc/salt/minion_id || true
echo "cleaning up resolvconf"
sed -i '/172\.18\.208\.44/d' /etc/resolvconf/resolv.conf.d/base
# Remove flags
rm -v /done_ubuntu_base || true
rm -v /done_ubuntu_salt_bootstrap || true
# Clear\drop cache's
sync
echo 3 > /proc/sys/vm/drop_caches