aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/netbase
diff options
context:
space:
mode:
authorKlaus Kurzmann <mok@fluxnetz.de>2009-11-22 22:19:24 +0100
committerKlaus Kurzmann <mok@fluxnetz.de>2009-11-22 22:19:24 +0100
commit096bf89af85e43310145999a6030a0e25ab46263 (patch)
treeab505fadf2556805f867b3f513837684a9b32534 /recipes/netbase
parent646b1eb8132a5126462dc8a4846ec6d9adc11ca5 (diff)
downloadopenembedded-096bf89af85e43310145999a6030a0e25ab46263.tar.gz
netbase: add init and options for SHR distro
Signed-off-by: Klaus Kurzmann <mok@fluxnetz.de>
Diffstat (limited to 'recipes/netbase')
-rw-r--r--recipes/netbase/netbase/shr/init46
-rw-r--r--recipes/netbase/netbase/shr/options1
2 files changed, 47 insertions, 0 deletions
diff --git a/recipes/netbase/netbase/shr/init b/recipes/netbase/netbase/shr/init
new file mode 100644
index 0000000000..32810dc913
--- /dev/null
+++ b/recipes/netbase/netbase/shr/init
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# manage network interfaces and configure some networking options
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+if ! [ -x /sbin/ifup ]; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ echo -n "Configuring network interfaces... "
+ ifup -a
+ echo "done."
+ ;;
+ stop)
+ if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+ grep -q "^/ nfs$"; then
+ echo "NOT deconfiguring network interfaces: / is an NFS mount"
+ elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+ grep -q "^/ smbfs$"; then
+ echo "NOT deconfiguring network interfaces: / is an SMB mount"
+ elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
+ grep -qE '^(nfs|smbfs|ncp|coda)$'; then
+ echo "NOT deconfiguring network interfaces: network shares still mounted."
+ else
+ echo -n "Deconfiguring network interfaces... "
+ ifdown -a
+ echo "done."
+ fi
+ ;;
+ force-reload|restart)
+ echo -n "Reconfiguring network interfaces... "
+ ifdown -a
+ ifup -a
+ echo "done."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/recipes/netbase/netbase/shr/options b/recipes/netbase/netbase/shr/options
new file mode 100644
index 0000000000..1cbffcb365
--- /dev/null
+++ b/recipes/netbase/netbase/shr/options
@@ -0,0 +1 @@
+# DEPRECATED by /etc/sysctl.conf