blob: 4eb9c7f33d49865d2d9d8f06a042f18fca2fcb7d [file] [log] [blame]
Richard Felkld59c5652018-02-08 13:14:05 +01001#!/bin/bash -xe
azvyagintsev4053eb22018-03-29 16:21:51 +03002
Richard Felkld59c5652018-02-08 13:14:05 +01003apt-get -y autoremove --purge
4apt-get -y clean
5rm -rf /var/lib/apt/lists/*
6
7rm -f /usr/sbin/policy-rc.d || true
8
9echo "cleaning up hostname"
azvyagintsevc86fbaf2018-03-02 18:57:03 +020010sed -i "/.*ubuntu.*/d" /etc/hosts
11sed -i "/.*salt.*/d" /etc/hosts
Richard Felkld59c5652018-02-08 13:14:05 +010012
13echo "cleaning up guest additions"
14rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.? || true
15
16echo "cleaning up dhcp leases"
17rm -rf /var/lib/dhcp/* || true
azvyagintsevffa75b42018-06-06 20:38:54 +030018rm -rf /var/lib/ntp/ntp.conf.dhcp || true
Richard Felkld59c5652018-02-08 13:14:05 +010019
20echo "cleaning up udev rules"
21rm -f /etc/udev/rules.d/70-persistent-net.rules || true
22rm -rf /dev/.udev/ || true
23rm -f /lib/udev/rules.d/75-persistent-net-generator.rules || true
24
25echo "cleaning up minion_id for salt"
26rm -f /etc/salt/minion_id || true
27
Richard Felkl47757902018-03-02 22:44:43 +010028echo "cleaning up resolvconf"
azvyagintsev4053eb22018-03-29 16:21:51 +030029sed -i '/172\.18\.208\.44/d' /etc/resolvconf/resolv.conf.d/base
30
31# Clear\drop cache's
32sync
33echo 3 > /proc/sys/vm/drop_caches