summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/networking
diff options
context:
space:
mode:
Diffstat (limited to 'src.etc/init.d/networking')
-rwxr-xr-xsrc.etc/init.d/networking28
1 files changed, 13 insertions, 15 deletions
diff --git a/src.etc/init.d/networking b/src.etc/init.d/networking
index bfc50e4..b15918a 100755
--- a/src.etc/init.d/networking
+++ b/src.etc/init.d/networking
@@ -3,23 +3,21 @@
start()
{
log 'Configuring network interfaces'
- exec 3>/etc/network/interfaces
- printf '# GENERATED FILE. DO NO EDIT.\n' >&3
- printf '# Edit /etc/network/interfaces.local instead.\n\n' >&3
- printf 'auto lo\niface lo inet loopback\n\n' >&3
- for iface in /sys/class/net/eth* /sys/class/net/wlan*; do
- [ -e "${iface}" ] || continue
- iface="${iface##*/}"
- printf 'auto %s\niface %s inet dhcp\n\n' \
- "${iface}" "${iface}" >&3
- done
- exec 3>&-
- if [ -e /etc/network/interfaces.local ]; then
- file=/etc/network/interfaces.local
+ if [ -e /etc/network/interfaces ]; then
+ cp /etc/network/interfaces /var/run/net-ifaces
else
- file=/etc/network/interfaces
+ exec 3>/var/run/net-ifaces
+ printf '# GENERATED FILE. DO NO EDIT.\n' >&3
+ printf '# Edit /etc/network/interfaces instead.\n\n' >&3
+ printf 'auto lo\niface lo inet loopback\n\n' >&3
+ for iface in /sys/class/net/eth* /sys/class/net/wlan*; do
+ [ -e "${iface}" ] || continue
+ iface="${iface##*/}"
+ printf 'auto %s\niface %s inet dhcp\n\n' \
+ "${iface}" "${iface}" >&3
+ done
+ exec 3>&-
fi
- cp "${file}" /var/run/net-ifaces
ifup -a -i /var/run/net-ifaces
}