summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/networking
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-11-04 04:58:32 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-11-04 04:58:32 (EST)
commit9c1994bb9be91a3329d4aa52f3b515ce340f6bdb (patch)
treeccaf461ed2d5dd6f4fc019d2b93cf8a770df9ea6 /src.etc/init.d/networking
parent1558d05c62ed90f7d93a14533541c33896b7b733 (diff)
/etc/init.d/networking: Write /var/run/net-ifaces
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
}