finally move buildroot-ng to trunk
[openwrt.git] / package / base-files / default / etc / rc.common
1 #!/bin/sh
2 . /etc/functions.sh
3
4 start() {
5 return 0
6 }
7
8 stop() {
9 return 0
10 }
11
12 reload() {
13 return 1
14 }
15
16 restart() {
17 stop
18 start
19 }
20
21 boot() {
22 start
23 }
24
25 shutdown() {
26 return 0
27 }
28
29 disable() {
30 rm -f /etc/rc.d/${initscript##*/}
31 }
32
33 enable() {
34 disable
35 ln -s /etc/init.d/${initscript##*/} /etc/rc.d/${initscript##*/}
36 }
37
38 depends() {
39 return 0
40 }
41
42 help() {
43 cat <<EOF
44 Syntax: $initscript [command]
45
46 Available commands:
47 start Start the service
48 stop Stop the service
49 restart Restart the service
50 reload Reload configuration files (or restart if that fails)
51 $EXTRA_HELP
52 EOF
53 }
54
55 initscript="$1"
56 action="$2"
57
58 . "$initscript"
59
60 cmds=
61 for cmd in $EXTRA_COMMANDS; do
62 cmds="$cmd) $cmd;;"
63 done
64 eval "case \"\$action\" in
65 start) start;;
66 stop) stop;;
67 reload) reload || restart;;
68 restart) restart;;
69 boot) boot;;
70 shutdown) shutdown;;
71 $cmds
72 *) help;;
73 esac"
This page took 0.053835 seconds and 5 git commands to generate.