29 lines
848 B
Bash
29 lines
848 B
Bash
# Clean up
|
|
apt-get -y remove linux-headers-$(uname -r) build-essential
|
|
apt-get -y autoremove
|
|
apt-get -y clean
|
|
|
|
# Removing leftover leases and persistent rules
|
|
echo "cleaning up dhcp leases"
|
|
rm /var/lib/dhcp/*
|
|
|
|
# Make sure Udev doesn't block our network
|
|
echo "cleaning up udev rules"
|
|
rm /etc/udev/rules.d/70-persistent-net.rules
|
|
mkdir /etc/udev/rules.d/70-persistent-net.rules
|
|
rm -rf /dev/.udev/
|
|
rm /lib/udev/rules.d/75-persistent-net-generator.rules
|
|
|
|
echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
|
|
echo "pre-up sleep 2" >> /etc/network/interfaces
|
|
|
|
# Remove the proxy for root and the proxy for apt
|
|
if grep _proxy /root/.bashrc; then
|
|
mv /root/.bashrc /root/.bashrc-with_proxy
|
|
grep -v _proxy /root/.bashrc-with_proxy > /root/.bashrc
|
|
fi
|
|
|
|
if [ -e /etc/apt/apt.conf.d/HPproxy ]; then
|
|
rm /etc/apt/apt.conf.d/HPproxy
|
|
fi
|