summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/netbase/netbase/init
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/netbase/netbase/init')
-rw-r--r--meta/recipes-core/netbase/netbase/init52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-core/netbase/netbase/init b/meta/recipes-core/netbase/netbase/init
new file mode 100644
index 0000000000..8a67e1cef2
--- /dev/null
+++ b/meta/recipes-core/netbase/netbase/init
@@ -0,0 +1,52 @@
1#!/bin/sh
2#
3### BEGIN INIT INFO
4# Provides: networking
5# Required-Start: $local_fs mountvirtfs
6# Required-Stop: $local_fs
7# Default-Start: S
8# Default-Stop: 0 6
9# Short-Description: Raise network interfaces and configure them
10### END INIT INFO
11
12PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
13
14if ! [ -x /sbin/ifup ]; then
15 exit 0
16fi
17
18case "$1" in
19 start)
20 echo -n "Configuring network interfaces... "
21 ifup -a
22 echo "done."
23 ;;
24 stop)
25 if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
26 grep -q "^/ nfs$"; then
27 echo "NOT deconfiguring network interfaces: / is an NFS mount"
28 elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
29 grep -q "^/ smbfs$"; then
30 echo "NOT deconfiguring network interfaces: / is an SMB mount"
31 elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
32 grep -qE '^(nfs|smbfs|ncp|coda)$'; then
33 echo "NOT deconfiguring network interfaces: network shares still mounted."
34 else
35 echo -n "Deconfiguring network interfaces... "
36 ifdown -a
37 echo "done."
38 fi
39 ;;
40 force-reload|restart)
41 echo -n "Reconfiguring network interfaces... "
42 ifdown -a
43 ifup -a
44 echo "done."
45 ;;
46 *)
47 echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
48 exit 1
49 ;;
50esac
51
52exit 0