ef0d3da5ddd6d254260c597bd0f195625e37b25a
[packer_vagrant.git] / scripts / cleanup.sh
1 #!/bin/bash
2
3 chmod 440 /etc/sudoers.d/vagrant
4
5 # Removing leftover leases and persistent rules
6 echo "cleaning up dhcp leases"
7 rm /var/lib/dhcp/*
8
9 # Make sure Udev doesn't block our network
10 echo "cleaning up udev rules"
11 rm /etc/udev/rules.d/70-persistent-net.rules
12 mkdir /etc/udev/rules.d/70-persistent-net.rules
13 rm -rf /dev/.udev/
14 rm /lib/udev/rules.d/75-persistent-net-generator.rules
15
16 echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
17 echo "pre-up sleep 2" >> /etc/network/interfaces