Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Check wan_ifname before using it:
Browse files Browse the repository at this point in the history
Bug on Unify:  Non-existing eth1 is assigned by OpenWRT
  • Loading branch information
yanosz committed Aug 7, 2014
1 parent 6beca22 commit 484e45d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion files/lib/freifunk/upgrade/initial/011-freifunk-network
Expand Up @@ -8,6 +8,13 @@ local board="$(ar71xx_board_name)"
local wan_ifname="$(uci get network.wan.ifname)"
local main_mac="$(get_main_address)"

if [ -n "$wan_ifname" ]; then
ifconfig $wan_ifname
if [ $? -ne 0 ]; then
wan_ifname=""
fi
fi

uci -q batch <<EOF
delete network.lan
delete network.wan6
Expand All @@ -21,8 +28,10 @@ set network.wan.auto='1'
set network.freifunk='interface'
EOF



# Falls kein WAN-Interface vorhanden, nutze einziges LAN-Interface
if [ -z "$wan_ifname" ]
if [ -n "$wan_ifname" ]
then
uci set network.freifunk.ifname="bat0"
uci set network.wan.ifname="$lan_ifname"
Expand Down

0 comments on commit 484e45d

Please sign in to comment.