pid_file_vis="/var/run/batadv-vis.pid"
enable=0
vis_enable=0
+batmanif=""
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
{
local args=""
local section="$1"
- local disabled interface mode batmanif
+ local disabled interface mode
# check if section is disabled
config_get_bool disabled "$section" disabled 0
if [ "$enable" = "0" ]; then
exit 0
fi
+
+ mesh_dir="/sys/class/net/$batmanif/mesh/"
+ if ! [ -d "$mesh_dir" ] ; then
+ timeout=30
+ echo "${initscript}: waiting $timeout secs for $batmanif interface..."
+ for i in $(seq $timeout); do
+ sleep 1
+ [ -d "$mesh_dir" ] && break
+ if [ $i == $timeout ] ; then
+ echo "${initscript}: $batmanif not detected, alfred not starting."
+ exit 1
+ fi
+ done
+ fi
+
echo "${initscript}: starting alfred"
SERVICE_PID_FILE="$pid_file_alfred"
service_start /usr/sbin/alfred ${alfred_args}