1 #!/bin/sh /etc/rc.common
4 # Copyright (C) 2013 OpenWrt.org
6 # This is free software, licensed under the GNU General Public License v2.
7 # See /LICENSE for more information.
14 pid_file_alfred
="/var/run/alfred.pid"
15 pid_file_vis
="/var/run/vis.pid"
25 local disabled interface mode batmanif
27 # check if section is disabled
28 config_get_bool disabled
"$section" disabled
0
29 [ $disabled = 0 ] ||
return 1
33 config_get interface
"$section" interface
34 append args
"-i $interface"
36 config_get mode
"$section" mode
37 [ "$mode" = "master" ] && append args
"-m"
39 config_get batmanif
"$section" batmanif
40 append args
"-b $batmanif"
42 append alfred_args
"$args"
45 config_get_bool start_vis
"$section" start_vis
0
46 if [ "$start_vis" = 1 ] && [ -x /usr
/sbin
/vis
]; then
48 append vis_args
"-i $batmanif -s"
57 config_foreach alfred_start alfred
59 if [ "$enable" = "0" ]; then
62 echo "${initscript}: starting alfred"
63 SERVICE_PID_FILE
="$pid_file_alfred"
64 service_start
/usr
/sbin
/alfred
${alfred_args}
66 if [ "$vis_enable" = "0" ]; then
69 echo "${initscript}: starting vis"
70 SERVICE_PID_FILE
="$pid_file_vis"
71 service_start
/usr
/sbin
/vis
${vis_args}
76 SERVICE_PID_FILE
="$pid_file_alfred"
77 service_stop
/usr
/sbin
/alfred
78 SERVICE_PID_FILE
="$pid_file_vis"
79 [ -x /usr
/sbin
/vis
] && service_stop
/usr
/sbin
/vis