#!/bin/sh . /etc/functions.sh config_load fon config_get fallback wan fallback exists() { ( < $1 ) 2>&- } equal() { case "$1" in "$2") return 0 ;; *) return 255 ;; esac } save_setting() { mkdir -p /tmp/.webif cat >> /tmp/.webif/config-$1 < /etc/config/$cfgfile.new <>/tmp/.startup_log echo "`uptime | awk -F" " '{print $1}'`: WiFi Uplink does not seem to work properly, switching to 'dhcp'-mode and restarting..." >/dev/console killall wpa_supplicant if ! equal "$fallback" "0" save_setting fon wan mode "dhcp" commit_settings fi /bin/restartfonera fi