netifd,lldpd,rpcd,log: use generic service_running
[openwrt/staging/mkresin.git] / package / network / config / netifd / files / etc / init.d / network
index bdadbbce6db6f9383a0e2c7fab25e7f5d8823091..dc208c4ce0a1f5982d732860111421257540bfd2 100755 (executable)
@@ -26,19 +26,18 @@ start_service() {
 }
 
 reload_service() {
+       local rv=0
+
        init_switch
-       ubus call network reload
+       ubus call network reload || rv=1
        /sbin/wifi reload_legacy
+       return $rv
 }
 
-stop() {
+stop_service() {
        /sbin/wifi down
-       procd_kill network ''
-}
-
-service_running() {
-       ubus -t 30 wait_for network.interface
-       /sbin/wifi reload_legacy
+       ifdown -a
+       sleep 1
 }
 
 validate_atm_bridge_section()
@@ -111,7 +110,9 @@ validate_switch_section()
                'name:string' \
                'enable:bool' \
                'enable_vlan:bool' \
-               'reset:bool'
+               'reset:bool' \
+               'ar8xxx_mib_poll_interval:uinteger' \
+               'ar8xxx_mib_type:range(0,1)'
 }
 
 validate_switch_vlan()
@@ -129,22 +130,14 @@ service_triggers()
        procd_open_validate
        validate_atm_bridge_section
        validate_route_section
-       validate_route6_section
+       [ -e /proc/sys/net/ipv6 ] && validate_route6_section
        validate_rule_section
-       validate_rule6_section
+       [ -e /proc/sys/net/ipv6 ] && validate_rule6_section
        validate_switch_section
        validate_switch_vlan
        procd_close_validate
 }
 
-restart() {
-       ifdown -a
-       sleep 1
-       trap '' TERM
-       stop "$@"
-       start "$@"
-}
-
 shutdown() {
        ifdown -a
        sleep 1