1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008-2013 OpenWrt.org
9 OLSRD_OLSRD_SCHEMA
='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes'
10 OLSRD_IPCCONNECT_SCHEMA
='ignore:internal Host:list Net:list2'
11 OLSRD_LOADPLUGIN_SCHEMA
='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2 ipv6only:bool'
12 OLSRD_INTERFACE_SCHEMA
='ignore:internal interface:internal AutoDetectChanges:bool LinkQualityMult:list2'
13 OLSRD_INTERFACE_DEFAULTS_SCHEMA
='AutoDetectChanges:bool'
18 #6and4: backward compatibility - it MUST be different from /etc/init.d/olsrd6 PID variable
19 PID6
=/var
/run
/olsrd6and4.pid
22 logger
-t olsrd
-p daemon.info
-s "${initscript}: $@"
26 logger
-t olsrd
-p daemon.err
-s "${initscript}: ERROR: $@"
30 logger
-t olsrd
-p daemon.warn
-s "${initscript}: WARNING: $@"
35 [ -z "$varname" -o "$varname" != "${varname%%[!A-Za-z0-9_]*}" ] && return 1
39 validate_olsrd_option
() {
41 [ -z "$str" -o "$str" != "${str%%[! 0-9A-Za-z.%/|:_-]*}" ] && return 1
47 local cfgt hostname latlon oldIFS
49 config_get cfgt
"$cfg" TYPE
51 if [ "$cfgt" = "system" ]; then
52 config_get hostname
"$cfg" hostname
53 hostname
="${hostname:-OpenWrt}"
54 SYSTEM_HOSTNAME
="$hostname"
57 if [ -z "$SYSTEM_LAT" -o -z "$SYSTEM_LON" ]; then
58 config_get latlon
"$cfg" latlon
59 oldIFS
="$IFS"; IFS
=" ${T}${N},"; set -- $latlon; IFS
="$oldIFS"
64 if [ -z "$SYSTEM_LAT" -o -z "$SYSTEM_LON" ]; then
65 config_get latlon
"$cfg" latitude
67 config_get latlon
"$cfg" longitude
72 olsrd_find_config_file
() {
74 validate_varname
"$cfg" ||
return 0
76 config_get_bool ignore
"$cfg" ignore
0
77 [ "$ignore" -ne 0 ] && return 0
78 config_get OLSRD_CONFIG_FILE
"$cfg" config_file
83 warning_invalid_value
() {
84 local funcname
="warning_invalid_value"
86 validate_varname
"$package" || package
=
88 validate_varname
"$config" || config
=
90 validate_varname
"$option" || option
=
92 if [ -n "$package" -a -n "$config" ]; then
93 log
"$funcname() in option '$package.$config${option:+.}$option', skipped"
95 log
"$funcname() skipped"
101 olsrd_write_option
() {
104 validate_varname
"$cfg" ||
return 1
106 validate_varname
"$option" ||
return 1
108 local option_type
="$5"
110 if [ "$option_type" = bool
]; then
112 1|on|true|enabled|
yes) value
=yes;;
113 0|off|false|disabled|no
) value
=no
;;
114 *) warning_invalid_value olsrd
"$cfg" "$option"; return 1;;
118 if ! validate_olsrd_option
"$value"; then
119 warning_invalid_value olsrd
"$cfg" "$option"
123 if [ "$value" != "${value%%[G-Zg-z_-]*}" ]; then
124 if [ "$option" != "Ip6AddrType" -a "$option" != "LinkQualityMult" -a "$value" != "yes" -a "$value" != "no" ]; then
129 echo -n "${N}$param$option $value"
134 olsrd_write_plparam
() {
135 local funcname
="olsrd_write_plparam"
138 validate_varname
"$cfg" ||
return 1
140 validate_varname
"$option" ||
return 1
142 local option_type
="$5"
145 if [ "$option_type" = bool
]; then
147 1|on|true|enabled|
yes) value
=yes;;
148 0|off|false|disabled|no
) value
=no
;;
149 *) warning_invalid_value olsrd
"$cfg" "$option"; return 1;;
153 if ! validate_olsrd_option
"$value"; then
154 warning_invalid_value olsrd
"$cfg" "$option"
165 if [ "$option" = 'hosts' ]; then
172 if [ "$option" = 'NonOlsrIf' ]; then
173 if validate_varname
"$value"; then
174 if network_get_device ifname
"$value"; then
175 log
"$funcname() Info: mdns Interface '$value' ifname '$ifname' found"
177 log
"$funcname() Warning: mdns Interface '$value' not found, skipped"
180 warning_invalid_value olsrd
"$cfg" "NonOlsrIf"
182 [ -z "$ifname" ] || value
=$ifname
185 echo -n "${N}${param}PlParam \"$option\" \"$value\""
190 config_update_schema
() {
191 local schema_varname
="$1"
192 validate_varname
"$schema_varname" ||
return 1
194 validate_varname
"$command" ||
return 1
196 validate_varname
"$option" ||
return 1
206 eval "export -n -- \"schema=\${$schema_varname}\""
208 for cur_option
in $schema; do
209 [ "${cur_option%%[:=]*}" = "$option" ] && return 0
212 if [ "$command" = list
]; then
214 if [ "$#" -ge "3" ]; then
215 schema_entry
="$option:list3"
216 elif [ "$#" -ge "2" ]; then
217 schema_entry
="$option:list2"
219 schema_entry
="$option:list"
222 schema_entry
="$option"
225 append
"$schema_varname" "$schema_entry"
230 config_write_options
() {
231 local funcname
="config_write_options"
234 validate_varname
"$cfg" ||
return 1
235 local write_func
="$3"
236 [ -z "$write_func" ] && output_func
=echo
237 local write_param
="$4"
239 local schema_entry option option_length option_type default value list_size list_item list_value i position speed oldIFS
240 local list_speed_vars
="HelloInterval HelloValidityTime TcInterval TcValidityTime MidInterval MidValidityTime HnaInterval HnaValidityTime"
242 get_value_for_entry
()
244 local schema_entry
="$1"
246 default
="${schema_entry#*[=]}"
247 [ "$default" = "$schema_entry" ] && default
=
248 option
="${schema_entry%%[=]*}"
250 oldIFS
="$IFS"; IFS
=':'; set -- $option; IFS
="$oldIFS"
254 validate_varname
"$option" ||
return 1
255 [ -z "$option_type" ] || validate_varname
"$option_type" ||
return 1
256 [ "$option_type" = internal
] && return 1
258 config_get value
"$cfg" "$option"
259 [ "$option" = "speed" ] && return 1
276 already_in_schema
"speed" && {
277 get_value_for_entry
"speed"
279 if [ 2>/dev
/null
$value -gt 0 -a $value -le 20 ]; then
282 log
"$funcname() Warning: invalid speed-value: '$value' - allowed integers: 1...20, fallback to 6"
286 for schema_entry
in $list_speed_vars; do {
287 already_in_schema
"$schema_entry" || schema
="$schema $schema_entry"
291 for schema_entry
in $schema; do
292 if [ -n "$speed" ]; then # like sven-ola freifunk firmware fff-1.7.4
293 case "$schema_entry" in
295 value
="$(( $speed / 2 + 1 )).0"
298 value
="$(( $speed * 25 )).0"
300 TcInterval
) # todo: not fisheye? -> $(( $speed * 2 ))
301 value
=$
(( $speed / 2 ))
302 [ $value -eq 0 ] && value
=1
306 value
="$(( $speed * 100 )).0"
309 value
="$(( $speed * 5 )).0"
312 value
="$(( $speed * 100 )).0"
315 value
="$(( $speed * 2 )).0"
318 value
="$(( $speed * 25 )).0"
321 get_value_for_entry
"$schema_entry" ||
continue
327 case " $list_speed_vars " in
337 is_speed_var
"$schema_entry" && option
="$schema_entry"
339 get_value_for_entry
"$schema_entry" ||
continue
342 if [ -z "$value" ]; then
343 oldIFS
="$IFS"; IFS
='+'; set -- $default; IFS
="$oldIFS"
345 elif [ "$value" = '-' -a -n "$default" ]; then
349 [ -z "$value" ] && continue
351 case "$option_type" in
358 if [ "$list_size" -gt 0 ]; then
359 config_get option_length
"$cfg" "${option}_LENGTH"
360 if [ -n "$option_length" ]; then
362 while [ "$i" -le "$option_length" ]; do
363 config_get list_value
"$cfg" "${option}_ITEM$i"
364 "$write_func" "$write_param" "$cfg" "$option" "$list_value" "$option_type" ||
break
370 for list_item
in $value; do
371 append
"list_value" "$list_item"
373 position
=$
((i
% list_size
))
374 if [ "$position" -eq 0 ]; then
375 "$write_func" "$write_param" "$cfg" "$option" "$list_value" "$option_type" ||
break
379 [ "$position" -ne 0 ] && "$write_func" "$write_param" "$cfg" "$option" "$list_value" "$option_type"
382 "$write_func" "$write_param" "$cfg" "$option" "$value" "$option_type"
389 olsrd_write_olsrd
() {
391 validate_varname
"$cfg" ||
return 0
394 config_get_bool ignore
"$cfg" ignore
0
395 [ "$ignore" -ne 0 ] && return 0
397 [ "$OLSRD_COUNT" -gt 0 ] && return 0
399 config_get ipversion
"$cfg" IpVersion
400 if [ "$UCI_CONF_NAME" == "olsrd6" ]; then
401 OLSRD_OLSRD_SCHEMA
="$OLSRD_OLSRD_SCHEMA IpVersion=6"
402 if [ "$ipversion" = "6and4" ]; then
403 error
"IpVersion 6and4 not supported in olsrd6"
407 if [ "$ipversion" = "6and4" ]; then
408 OLSRD_IPVERSION_6AND4
=1
409 config_set
"$cfg" IpVersion
'6'
412 config_get smartgateway
"$cfg" SmartGateway
413 config_get smartgatewayuplink
"$cfg" SmartGatewayUplink
415 config_write_options
"$OLSRD_OLSRD_SCHEMA" "$cfg" olsrd_write_option
417 OLSRD_COUNT
=$
((OLSRD_COUNT
+ 1))
421 olsrd_write_ipcconnect
() {
423 validate_varname
"$cfg" ||
return 0
426 config_get_bool ignore
"$cfg" ignore
0
427 [ "$ignore" -ne 0 ] && return 0
429 [ "$IPCCONNECT_COUNT" -gt 0 ] && return 0
431 echo -n "${N}IpcConnect${N}{"
432 config_write_options
"$OLSRD_IPCCONNECT_SCHEMA" "$cfg" olsrd_write_option
"${T}"
434 IPCCONNECT_COUNT
=$
((IPCCONNECT_COUNT
+ 1))
441 validate_varname
"$cfg" ||
return 0
444 config_get_bool ignore
"$cfg" ignore
0
445 [ "$ignore" -ne 0 ] && return 0
447 config_get netaddr
"$cfg" netaddr
448 if ! validate_olsrd_option
"$netaddr"; then
449 warning_invalid_value olsrd
"$cfg" "netaddr"
453 config_get netmask
"$cfg" netmask
454 if ! validate_olsrd_option
"$netmask"; then
455 warning_invalid_value olsrd
"$cfg" "netmask"
459 [ "$HNA4_COUNT" -le 0 ] && echo -n "${N}Hna4${N}{"
460 echo -n "${N}${T}${T}$netaddr $netmask"
461 HNA4_COUNT
=$
((HNA4_COUNT
+ 1))
468 validate_varname
"$cfg" ||
return 0
471 config_get_bool ignore
"$cfg" ignore
0
472 [ "$ignore" -ne 0 ] && return 0
474 config_get netaddr
"$cfg" netaddr
475 if ! validate_olsrd_option
"$netaddr"; then
476 warning_invalid_value olsrd
"$cfg" "netaddr"
480 config_get prefix
"$cfg" prefix
481 if ! validate_olsrd_option
"$prefix"; then
482 warning_invalid_value olsrd
"$cfg" "prefix"
486 [ "$HNA6_COUNT" -le 0 ] && echo -n "${N}Hna6${N}{"
487 echo -n "${N}${T}${T}$netaddr $prefix"
488 HNA6_COUNT
=$
((HNA6_COUNT
+ 1))
493 olsrd_write_loadplugin
() {
494 local funcname
="olsrd_write_loadplugin"
496 validate_varname
"$cfg" ||
return 0
504 config_get_bool ignore
"$cfg" ignore
0
505 [ "$ignore" -ne 0 ] && return 0
507 config_get library
"$cfg" library
508 if ! validate_olsrd_option
"$library"; then
509 warning_invalid_value olsrd
"$cfg" "library"
512 if ! [ -x "/lib/$library" -o -x "/usr/lib/$library" -o -x "/usr/local/lib/$library" ]; then
513 log
"$funcname() Warning: Plugin library '$library' not found, skipped"
519 config_get name
"$cfg" name
520 [ -z "$name" ] && config_set
"$cfg" name
$SYSTEM_HOSTNAME
522 config_get suffix
"$cfg" suffix
523 [ -z "$suffix" ] && config_set
"$cfg" suffix
'.olsr'
525 config_get lat
"$cfg" lat
526 config_get lon
"$cfg" lon
527 config_get latlon_infile
"$cfg" latlon_infile
528 if [ \
( -z "$lat" -o -z "$lat" \
) -a -z "$latlon_infile" ]; then
529 if [ -f '/var/run/latlon.txt' ]; then
530 config_set
"$cfg" lat
''
531 config_set
"$cfg" lon
''
532 config_set
"$cfg" latlon_infile
'/var/run/latlon.txt'
534 config_set
"$cfg" lat
"$SYSTEM_LAT"
535 config_set
"$cfg" lon
"$SYSTEM_LON"
539 for f
in latlon_file hosts_file services_file resolv_file macs_file
; do
540 config_get
$f "$cfg" $f
543 [ -z "$latlon_file" ] && config_set
"$cfg" latlon_file
'/var/run/latlon.js'
546 config_get wd_file
"$cfg" file
550 echo -n "${N}LoadPlugin \"$library\"${N}{"
551 config_write_options
"$OLSRD_LOADPLUGIN_SCHEMA" "$cfg" olsrd_write_plparam
"${T}"
557 olsrd_write_interface
() {
558 local funcname
="olsrd_write_interface"
560 validate_varname
"$cfg" ||
return 0
566 config_get_bool ignore
"$cfg" ignore
0
567 [ "$ignore" -ne 0 ] && return 0
570 config_get interfaces
"$cfg" interface
572 for interface
in $interfaces; do
573 if validate_varname
"$interface"; then
574 if network_get_device IFNAME
"$interface"; then
575 ifnames
="$ifnames \"$IFNAME\""
576 ifsglobal
="$ifsglobal $IFNAME"
577 elif network_get_physdev IFNAME
"$interface"; then
578 local proto
="$(uci -q get network.${interface}.proto)"
579 if [ "$proto" = "static" -o "$proto" = "none" ]; then
580 ifnames
="$ifnames \"$IFNAME\""
581 ifsglobal
="$ifsglobal $IFNAME"
584 log
"$funcname() Warning: Interface '$interface' not found, skipped"
587 warning_invalid_value olsrd
"$cfg" "interface"
591 [ -z "$ifnames" ] && return 0
593 echo -n "${N}Interface$ifnames${N}{"
594 config_write_options
"$OLSRD_INTERFACE_SCHEMA" "$cfg" olsrd_write_option
"${T}"
596 INTERFACES_COUNT
=$
((INTERFACES_COUNT
+ 1))
601 olsrd_write_interface_defaults
() {
603 validate_varname
"$cfg" ||
return 0
605 echo -n "${N}InterfaceDefaults$ifnames${N}{"
606 config_write_options
"$OLSRD_INTERFACE_DEFAULTS_SCHEMA" "$cfg" olsrd_write_option
"${T}"
612 olsrd_update_schema
() {
614 validate_varname
"$command" ||
return 0
616 validate_varname
"$varname" ||
return 0
618 local cfg
="$CONFIG_SECTION"
622 config_get cfgt
"$cfg" TYPE
624 olsrd
) config_update_schema OLSRD_OLSRD_SCHEMA
"$command" "$varname" "$value";;
625 IpcConnect
) config_update_schema OLSRD_IPCCONNECT_SCHEMA
"$command" "$varname" "$value";;
626 LoadPlugin
) config_update_schema OLSRD_LOADPLUGIN_SCHEMA
"$command" "$varname" "$value";;
627 Interface
) config_update_schema OLSRD_INTERFACE_SCHEMA
"$command" "$varname" "$value";;
628 InterfaceDefaults
) config_update_schema OLSRD_INTERFACE_DEFAULTS_SCHEMA
"$command" "$varname" "$value";;
634 olsrd_write_config
() {
635 OLSRD_IPVERSION_6AND4
=0
637 config_foreach olsrd_write_olsrd olsrd
639 config_foreach olsrd_write_ipcconnect IpcConnect
641 config_foreach olsrd_write_hna4 Hna4
642 [ "$HNA4_COUNT" -gt 0 ] && echo "${N}}"
644 config_foreach olsrd_write_hna6 Hna6
645 [ "$HNA6_COUNT" -gt 0 ] && echo "${N}}"
646 config_foreach olsrd_write_loadplugin LoadPlugin
648 config_foreach olsrd_write_interface_defaults InterfaceDefaults
649 config_foreach olsrd_write_interface Interface
657 local wanifnames word catch_next
659 which ip
>/dev
/null ||
return 1
661 set -- $
( ip route list exact
0.0.0.0/0 table all
)
668 [ -n "$catch_next" ] && {
669 case "$wanifnames" in
673 wanifnames
="$wanifnames $word "
686 olsrd_setup_smartgw_rules
() {
687 local funcname
="olsrd_setup_smartgw_rules"
688 # Check if ipip is installed
689 [ -e /etc
/modules.d
/[0-9]*-ipip ] ||
{
690 log
"$funcname() Warning: kmod-ipip is missing. SmartGateway will not work until you install it."
694 local wanifnames
="$( get_wan_ifnames )"
696 if [ -z "$wanifnames" ]; then
702 IP4T
=$
(which iptables
)
703 IP6T
=$
(which ip6tables
)
705 # Delete smartgw firewall rules first
706 if [ "$UCI_CONF_NAME" == "olsrd6" ]; then
707 while $IP6T -D forwarding_rule
-o tnl_
+ -j ACCEPT
2> /dev
/null
; do :;done
708 for IFACE
in $wanifnames; do
709 while $IP6T -D forwarding_rule
-i tunl0
-o $IFACE -j ACCEPT
2> /dev
/null
; do :; done
711 for IFACE
in $ifsglobal; do
712 while $IP6T -D input_rule
-i $IFACE -p 4 -j ACCEPT
2> /dev
/null
; do :; done
715 while $IP4T -D forwarding_rule
-o tnl_
+ -j ACCEPT
2> /dev
/null
; do :;done
716 for IFACE
in $wanifnames; do
717 while $IP4T -D forwarding_rule
-i tunl0
-o $IFACE -j ACCEPT
2> /dev
/null
; do :; done
719 for IFACE
in $ifsglobal; do
720 while $IP4T -D input_rule
-i $IFACE -p 4 -j ACCEPT
2> /dev
/null
; do :; done
722 while $IP4T -t nat
-D postrouting_rule
-o tnl_
+ -j MASQUERADE
2> /dev
/null
; do :;done
725 if [ "$smartgateway" == "yes" ]; then
726 log
"$funcname() Notice: Inserting firewall rules for SmartGateway"
727 if [ ! "$smartgatewayuplink" == "none" ]; then
728 if [ "$smartgatewayuplink" == "ipv4" ]; then
729 # Allow everything to be forwarded to tnl_+ and use NAT for it
730 $IP4T -I forwarding_rule
-o tnl_
+ -j ACCEPT
731 $IP4T -t nat
-I postrouting_rule
-o tnl_
+ -j MASQUERADE
732 # Allow forwarding from tunl0 to (all) wan-interfaces
733 if [ "$nowan"="0" ]; then
734 for IFACE
in $wanifnames; do
735 $IP4T -A forwarding_rule
-i tunl0
-o $IFACE -j ACCEPT
738 # Allow incoming ipip on all olsr-interfaces
739 for IFACE
in $ifsglobal; do
740 $IP4T -I input_rule
-i $IFACE -p 4 -j ACCEPT
742 elif [ "$smartgatewayuplink" == "ipv6" ]; then
743 $IP6T -I forwarding_rule
-o tnl_
+ -j ACCEPT
744 if [ "$nowan"="0" ]; then
745 for IFACE
in $wanifnames; do
746 $IP6T -A forwarding_rule
-i tunl0
-o $IFACE -j ACCEPT
749 for IFACE
in $ifsglobal; do
750 $IP6T -I input_rule
-i $IFACE -p 4 -j ACCEPT
753 $IP4T -t nat
-I postrouting_rule
-o tnl_
+ -j MASQUERADE
754 for IPT
in $IP4T $IP6T; do
755 $IPT -I forwarding_rule
-o tnl_
+ -j ACCEPT
756 if [ "$nowan"="0" ]; then
757 for IFACE
in $wanifnames; do
758 $IPT -A forwarding_rule
-i tunl0
-o $IFACE -j ACCEPT
761 for IFACE
in $ifsglobal; do
762 $IPT -I input_rule
-i $IFACE -p 4 -j ACCEPT
775 config_foreach system_config system
778 olsrd_update_schema
"option" "$@"
782 olsrd_update_schema
"list" "$@"
785 .
/lib
/functions
/network.sh
787 config_load
$UCI_CONF_NAME
791 config_foreach olsrd_find_config_file olsrd
793 if [ -z "$OLSRD_CONFIG_FILE" ]; then
794 mkdir
-p -- /var
/etc
/
795 olsrd_write_config
> /var
/etc
/$UCI_CONF_NAME.conf ||
return 1
796 if [ "$INTERFACES_COUNT" -gt 0 -a "$OLSRD_COUNT" -gt 0 ]; then
797 OLSRD_CONFIG_FILE
=/var
/etc
/$UCI_CONF_NAME.conf
801 [ -z "$OLSRD_CONFIG_FILE" ] && return 1
803 #6and4: backward compatibility
805 if [ "$OLSRD_IPVERSION_6AND4" -ne 0 ]; then
806 warn
"IpVersion 6and4 is deprecated and will be removed in future!"
807 warn
"You must use /etc/config/olsrd and /etc/init.d/olsrd for IPv4"
808 warn
" /etc/config/olsrd6 and /etc/init.d/olsrd6 for IPv6"
810 bindv6only
="$(sysctl -n net.ipv6.bindv6only)"
811 sysctl
-w net.ipv6.bindv6only
=1 > /dev
/null
812 sed -e '/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/d' < "$OLSRD_CONFIG_FILE" > /var
/etc
/olsrd.conf.ipv6
813 sed -e 's/^IpVersion[ ][ ]*6$/IpVersion 4/' -e 's/^\t\t[A-Fa-f0-9.:]*[:][A-Fa-f0-9.:]*[ ][0-9]*$//' < "$OLSRD_CONFIG_FILE" > /var
/etc
/olsrd.conf.ipv4
814 rm $OLSRD_CONFIG_FILE
816 # some filenames should get the suffix .ipv6
817 for file in $latlon_file $hosts_file $services_file $resolv_file $macs_file $wd_file;do
818 f
=$
(echo $file|
sed 's/\//\\\//g')
819 sed -i "s/$f/$f.ipv6/g" /var
/etc
/olsrd.conf.ipv6
822 SERVICE_PID_FILE
="$PID6"
823 if service_check
/usr
/sbin
/olsrd
; then
824 error
"there is already an IPv6 instance of olsrd running (pid: '$(cat $PID6)'), not starting."
826 service_start
/usr
/sbin
/olsrd
-f /var
/etc
/olsrd.conf.ipv6
-nofork
829 SERVICE_PID_FILE
="$PID"
830 if service_check
/usr
/sbin
/olsrd
; then
831 error
"there is already an IPv4 instance of olsrd running (pid: '$(cat $PID)'), not starting."
833 service_start
/usr
/sbin
/olsrd
-f /var
/etc
/olsrd.conf.ipv4
-nofork
837 sysctl
-w net.ipv6.bindv6only
="$bindv6only" > /dev
/null
839 SERVICE_PID_FILE
="$PID"
840 if service_check
/usr
/sbin
/olsrd
; then
841 error
"there is already an instance of $UCI_CONF_NAME running (pid: '$(cat $PID)'), not starting."
844 service_start
/usr
/sbin
/olsrd
-f "$OLSRD_CONFIG_FILE" -nofork
846 service_check
/usr
/sbin
/olsrd ||
{
847 log
"startup-error: check via: '/usr/sbin/olsrd -f \"$OLSRD_CONFIG_FILE\" -nofork'"
852 olsrd_setup_smartgw_rules
856 SERVICE_PID_FILE
="$PID"
857 service_stop
/usr
/sbin
/olsrd
859 #6and4: backward compatibility
860 SERVICE_PID_FILE
="$PID6"
861 service_stop
/usr
/sbin
/olsrd