Skip to content

Instantly share code, notes, and snippets.

@brimston3
Created February 14, 2017 22:31
Show Gist options
  • Save brimston3/f95e9d2708ca511ed2e574e3e80dadfe to your computer and use it in GitHub Desktop.
Save brimston3/f95e9d2708ca511ed2e574e3e80dadfe to your computer and use it in GitHub Desktop.
Things you should not do with /etc/network/interfaces
##################################################################
# If you have not read the multiple disclaimers, do not do this. #
# It is supposed to be a joke, haha. #
##################################################################
This goofiness is valid:
/etc/network/interfaces:
for procif in /etc/network/interfaces.d/*; do
procifname="$(basename $procif)"
source "$procif" "$procifname"
done
/etc/network/interfaces.d/eth0:
ActiveIF=$1
allow-hotplug $ActiveIF
iface $ActiveIF inet dhcp
/etc/network/interfaces.d/eth1 -> eth0
=======================================
But it's easier to do:
/etc/network/interfaces:
for procifname in eth0 eth1 eth2 eth3; do
allow-hotplug "$procifname"
iface "$procifname" inet dhcp
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment