source:
bootscripts/lfs/init.d/network@
5bc19fc
Last change on this file since 5bc19fc was 0cda898, checked in by , 13 years ago | |
---|---|
|
|
File size: 1.9 KB |
Rev | Line | |
---|---|---|
[1c48007] | 1 | #!/bin/sh |
2 | ######################################################################## | |
[0cda898] | 3 | # Begin network |
[1c48007] | 4 | # |
5 | # Description : Network Control Script | |
6 | # | |
7 | # Authors : Gerard Beekmans - gerard@linuxfromscratch.org | |
[0cda898] | 8 | # Nathan Coulson - nathan@linuxfromscratch.org |
9 | # Kevin P. Fleming - kpfleming@linuxfromscratch.org | |
10 | # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org | |
[1c48007] | 11 | # |
[0cda898] | 12 | # Version : LFS 7.0 |
[1c48007] | 13 | # |
14 | ######################################################################## | |
15 | ||
[0cda898] | 16 | ### BEGIN INIT INFO |
17 | # Provides: $network | |
18 | # Required-Start: $local_fs swap localnet | |
19 | # Should-Start: $syslog | |
20 | # Required-Stop: $local_fs swap localnet | |
21 | # Should-Stop: $syslog | |
22 | # Default-Start: 3 4 5 | |
23 | # Default-Stop: 0 1 2 6 | |
24 | # Short-Description: Starts and configures network interfaces. | |
25 | # Description: Starts and configures network interfaces. | |
26 | # X-LFS-Provided-By: LFS | |
27 | ### END INIT INFO | |
[1c48007] | 28 | |
29 | case "${1}" in | |
[0cda898] | 30 | start) |
31 | # Start all network interfaces | |
32 | for file in /etc/sysconfig/ifconfig.* | |
33 | do | |
34 | interface=${file##*/ifconfig.} | |
[1c48007] | 35 | |
[0cda898] | 36 | # skip if $file is * (because nothing was found) |
37 | if [ "${interface}" = "*" ] | |
38 | then | |
39 | continue | |
40 | fi | |
[1c48007] | 41 | |
[0cda898] | 42 | /sbin/ifup ${interface} |
43 | done | |
44 | ;; | |
[1c48007] | 45 | |
[0cda898] | 46 | stop) |
47 | # Reverse list | |
48 | FILES="" | |
49 | for file in /etc/sysconfig/ifconfig.* | |
50 | do | |
51 | FILES="${file} ${FILES}" | |
52 | done | |
[1c48007] | 53 | |
[0cda898] | 54 | # Stop all network interfaces |
55 | for file in ${FILES} | |
56 | do | |
57 | interface=${file##*/ifconfig.} | |
[1c48007] | 58 | |
[0cda898] | 59 | # skip if $file is * (because nothing was found) |
60 | if [ "${interface}" = "*" ] | |
61 | then | |
62 | continue | |
63 | fi | |
[1c48007] | 64 | |
[0cda898] | 65 | /sbin/ifdown ${interface} |
66 | done | |
67 | ;; | |
[1c48007] | 68 | |
[0cda898] | 69 | restart) |
70 | ${0} stop | |
71 | sleep 1 | |
72 | ${0} start | |
73 | ;; | |
[1c48007] | 74 | |
[0cda898] | 75 | *) |
76 | echo "Usage: ${0} {start|stop|restart}" | |
77 | exit 1 | |
78 | ;; | |
[1c48007] | 79 | esac |
80 | ||
[0cda898] | 81 | # End network |
Note:
See TracBrowser
for help on using the repository browser.