Ticket #19427: netwait

File netwait, 675 bytes (added by fedy.cz, 3 years ago)

quick fix

Line 
1#!/bin/sh /etc/rc.common
2
3START=21
4
5wait_for_ifaces() {
6  logger -t netwait "NetWait service: Checking if network interfaces are up ..."
7  local lan_up=`uci -p /var/state  get network.lan.up`
8  local loopback_up=`uci -p /var/state  get network.loopback.up`
9  while [ "$lan_up" != 1 -o "$loopback_up" != 1 ] ; do
10    logger -t netwait "NetWait service: Network interfaces not yet up, waiting ..."
11    sleep 2s
12    lan_up=`uci -p /var/state  get network.lan.up`
13    loopback_up=`uci -p /var/state  get network.loopback.up`
14  done;
15  logger -t netwait "NetWait service: Interfaces UP. Continue service startup."
16}
17
18start() {
19        wait_for_ifaces
20}
21
22stop() {
23        return
24}