done
}
+wait_for_interface()
+{
+ local ifname="$1"
+ local timeout=10
+ for i in $(seq $timeout); do
+ if [ $(ip -4 addr show dev $ifname 2> /dev/null | grep -c inet) -ne 0 ]; then
+ break
+ fi
+ sleep 1
+ if [ $i == $timeout ] ; then
+ nolog error "$ifname not detected, NoDogSplash not starting."
+ exit 1
+ fi
+ done
+}
+
generate_uci_config() {
local cfg="$1"
local val
return 1
fi
+ wait_for_interface "$ifname"
+
echo "GatewayInterface $ifname" >> $CONFIGFILE
append_config_option "$CONFIGFILE" "$cfg" gatewayname