Annotation of /trunk/busybox-initscripts/rc/localnet
Parent Directory | Revision Log
Revision 1194 -
(hide annotations)
(download)
Thu Jan 27 20:41:48 2011 UTC (13 years, 8 months ago) by niro
File size: 898 byte(s)
Thu Jan 27 20:41:48 2011 UTC (13 years, 8 months ago) by niro
File size: 898 byte(s)
-merged with upstream
1 | niro | 724 | #!/bin/sh |
2 | # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/localnet,v 1.1 2008-06-02 22:14:35 niro Exp $ | ||
3 | |||
4 | #%rlevels: 7:s 0:k | ||
5 | #%start: 80 | ||
6 | #%stop: 90 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/conf.d/rc | ||
14 | source ${rc_functions} | ||
15 | |||
16 | #get hostname | ||
17 | HOSTNAME="$(< /etc/hostname)" | ||
18 | |||
19 | case "$1" in | ||
20 | start) | ||
21 | niro | 1168 | rc_print "Bringing up the loopback interface ..." |
22 | niro | 724 | loadproc ifconfig lo 127.0.0.1 |
23 | |||
24 | niro | 1168 | rc_print "Setting hostname to ${HOSTNAME} ..." |
25 | niro | 724 | loadproc hostname ${HOSTNAME} |
26 | |||
27 | update_svcstatus $1 | ||
28 | splash svc_started "$(basename $0)" 0 | ||
29 | ;; | ||
30 | |||
31 | stop) | ||
32 | niro | 1168 | rc_print "Bringing down the loopback interface ..." |
33 | niro | 724 | loadproc ifconfig lo down |
34 | |||
35 | update_svcstatus $1 | ||
36 | splash svc_stopped "$(basename $0)" 0 | ||
37 | ;; | ||
38 | |||
39 | restart) | ||
40 | $0 stop | ||
41 | sleep 1 | ||
42 | $0 start | ||
43 | ;; | ||
44 | |||
45 | status) | ||
46 | niro | 1194 | rc_echo "Hostname is: $(hostname)" |
47 | niro | 724 | ifconfig lo |
48 | ;; | ||
49 | |||
50 | *) | ||
51 | niro | 1194 | rc_echo "Usage: $0 {start|stop|restart|status}" |
52 | niro | 724 | exit 1 |
53 | ;; | ||
54 | esac |