mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
layer2interface: for now populate network config ifnames along with layer2 configs
This commit is contained in:
parent
67e42d5efd
commit
595de81dff
1 changed files with 14 additions and 0 deletions
|
|
@ -4,6 +4,9 @@ local hasEthWan="1"
|
||||||
local hasAdsl="$(db -q get hw.board.hasAdsl)"
|
local hasAdsl="$(db -q get hw.board.hasAdsl)"
|
||||||
local hasVdsl="$(db -q get hw.board.hasVdsl)"
|
local hasVdsl="$(db -q get hw.board.hasVdsl)"
|
||||||
|
|
||||||
|
local LANPORTS="$(db -q get hw.board.ethernetLanPorts)"
|
||||||
|
local WANPORTS=""
|
||||||
|
|
||||||
# populate layer2_interface_ethernet #
|
# populate layer2_interface_ethernet #
|
||||||
if [ "$hasEthWan" == "1" ]; then
|
if [ "$hasEthWan" == "1" ]; then
|
||||||
local wanEthernetPort="$(db -q get hw.board.ethernetWanPort)"
|
local wanEthernetPort="$(db -q get hw.board.ethernetWanPort)"
|
||||||
|
|
@ -16,6 +19,8 @@ config ethernet_interface 'Wan'
|
||||||
option ifname '${wanEthernetPort}.1'
|
option ifname '${wanEthernetPort}.1'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
local ifname="$(uci -q get layer2_interface_ethernet.@ethernet_interface[0].ifname)"
|
||||||
|
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
|
||||||
elif [ "$hasEthWan" == "0" ]; then
|
elif [ "$hasEthWan" == "0" ]; then
|
||||||
echo "" > /etc/config/layer2_interface_ethernet
|
echo "" > /etc/config/layer2_interface_ethernet
|
||||||
fi
|
fi
|
||||||
|
|
@ -73,6 +78,8 @@ config atm_bridge
|
||||||
option 'atmtype' 'ubr'
|
option 'atmtype' 'ubr'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
local ifname="$(uci -q get layer2_interface_adsl.@atm_bridge[0].ifname)"
|
||||||
|
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
|
||||||
elif [ "$hasAdsl" == "0" ]; then
|
elif [ "$hasAdsl" == "0" ]; then
|
||||||
echo "" > /etc/config/layer2_interface_adsl
|
echo "" > /etc/config/layer2_interface_adsl
|
||||||
fi
|
fi
|
||||||
|
|
@ -93,8 +100,15 @@ config vdsl_interface
|
||||||
option 'ipqos' '1'
|
option 'ipqos' '1'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
local ifname="$(uci -q get layer2_interface_vdsl.@vdsl_interface[0].ifname)"
|
||||||
|
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
|
||||||
elif [ "$hasVdsl" == "0" ]; then
|
elif [ "$hasVdsl" == "0" ]; then
|
||||||
echo "" > /etc/config/layer2_interface_vdsl
|
echo "" > /etc/config/layer2_interface_vdsl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# populate network config ifnames #
|
||||||
|
uci -q get network.lan.ifname >/dev/null || uci -q set network.lan.ifname="$LANPORTS"
|
||||||
|
uci -q get network.wan.ifname >/dev/null || uci -q set network.wan.ifname="$WANPORTS"
|
||||||
|
uci commit network
|
||||||
|
|
||||||
sync
|
sync
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue