summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-06-14 12:30:48 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-06-14 12:35:14 (EDT)
commitaa128b328d9419644790c74a8a10cf0d2cadeff5 (patch)
tree03f8e42420ca69e9c721c59ccd4637cb2d045ea2
parent794a9d2d62de057550983d5e5f578e30b4806af5 (diff)
Generate /etc/network/interfaces at boot.
-rwxr-xr-xbusybox.pkg/postinst10
-rwxr-xr-xsrc.etc/init.d/networking9
2 files changed, 9 insertions, 10 deletions
diff --git a/busybox.pkg/postinst b/busybox.pkg/postinst
index 07b5c1f..f77b149 100755
--- a/busybox.pkg/postinst
+++ b/busybox.pkg/postinst
@@ -5,16 +5,6 @@ if [ "x${1}" = 'xconfigure' ]; then
update-alternatives --install "${link}" "${name}" \
"${link}.busybox" "${prio}"
done </usr/share/busybox/alternatives
- if [ -d /etc/network ] && ! [ -f /etc/network/interfaces ]; then
- exec 3>/etc/network/interfaces
- printf 'auto lo\niface lo inet loopback\n\n' >&3
- for iface in /sys/class/net/eth*; do
- iface="${iface##*/}"
- printf 'auto %s\niface %s inet dhcp\n\n' \
- "${iface}" "${iface}" >&3
- done
- exec 3>&-
- fi
if [ "x$(ls -A /var/www/ | head -n 1)" = 'x' ]; then
# There are no files in /var/www/.
cp /usr/share/busybox/www/index.html /var/www/index.html
diff --git a/src.etc/init.d/networking b/src.etc/init.d/networking
index 673cba5..25714c1 100755
--- a/src.etc/init.d/networking
+++ b/src.etc/init.d/networking
@@ -3,6 +3,15 @@
start()
{
log 'Configuring network interfaces'
+ exec 3>/etc/network/interfaces
+ printf 'auto lo\niface lo inet loopback\n\n' >&3
+ for iface in /sys/class/net/eth*; do
+ iface="${iface##*/}"
+ [ "x${iface}" = 'xeth*' ] && continue
+ 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
else