source: bootscripts-standard/clfs/init.d/network@ 91e0c48

Last change on this file since 91e0c48 was 7df280d, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Change /bin/sh to /bin/bash in the bootscripts because the bootscripts use bashisms. Having ash linked to sh will cause errors. Thanks to Bigdassaved for providing the diff and Copper for bring up the issue.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#!/bin/bash
2########################################################################
3# Begin $rc_base/init.d/network
4#
5# Description : Network Control Script
6#
7# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
8# Nathan Coulson - nathan@linuxfromscratch.org
9# Kevin P. Fleming - kpfleming@linuxfromscratch.org
10#
11# Version : 00.00
12#
13# Notes :
14#
15########################################################################
16
17. /etc/sysconfig/rc
18. ${rc_functions}
19. /etc/sysconfig/network
20
21case "${1}" in
22 start)
23 # Start all network interfaces
24 for file in ${network_devices}/ifconfig.*
25 do
26 interface=${file##*/ifconfig.}
27
28 # skip if $file is * (because nothing was found)
29 if [ "${interface}" = "*" ]
30 then
31 continue
32 fi
33
34 IN_BOOT=1 ${network_devices}/ifup ${interface}
35 done
36 ;;
37
38 stop)
39 # Reverse list
40 FILES=""
41 for file in ${network_devices}/ifconfig.*
42 do
43 FILES="${file} ${FILES}"
44 done
45
46 # Stop all network interfaces
47 for file in ${FILES}
48 do
49 interface=${file##*/ifconfig.}
50
51 # skip if $file is * (because nothing was found)
52 if [ "${interface}" = "*" ]
53 then
54 continue
55 fi
56
57 IN_BOOT=1 ${network_devices}/ifdown ${interface}
58 done
59 ;;
60
61 restart)
62 ${0} stop
63 sleep 1
64 ${0} start
65 ;;
66
67 *)
68 echo "Usage: ${0} {start|stop|restart}"
69 exit 1
70 ;;
71esac
72
73# End /etc/rc.d/init.d/network
Note: See TracBrowser for help on using the repository browser.