diff --git a/decompressed/gui_file/usr/share/transformer/scripts/check_wan.sh b/decompressed/gui_file/usr/share/transformer/scripts/check_wan.sh index 9b9bcb68..0cf8d54f 100755 --- a/decompressed/gui_file/usr/share/transformer/scripts/check_wan.sh +++ b/decompressed/gui_file/usr/share/transformer/scripts/check_wan.sh @@ -23,18 +23,21 @@ check_wan() { } set_sfp() { - if [ $sfp_wanlan_mode == "1" ]; then + + #this is to forcely use network.sfp otherwise /usr/sbin/sfp_get.sh will use network.sfptag that is managed by nothing + [ "$(uci get -q network.sfptag)" ] && uci delete network.sfptag + + if [ "$sfp_wanlan_mode" = "0" ]; then if [ ! "$(uci get -q network.lan.ifname | grep eth4)" ]; then uci set network.lan.ifname='eth0 eth1 eth2 eth3 eth4 eth5' - uci set network.sfptag.ifname='' uci commit /etc/init.d/network restart /etc/init.d/ethernet reload fi else - if [ ! "$(uci get -q network.sfptag.ifname | grep eth4)" ]; then + if [ ! "$(uci get -q network.sfp.ifname | grep eth4)" ]; then uci set network.lan.ifname='eth0 eth1 eth2 eth3 eth5' - uci set network.sfptag.ifname='eth4' + uci set network.sfp.ifname='eth4' uci commit /etc/init.d/network restart /etc/init.d/ethernet reload @@ -42,9 +45,9 @@ set_sfp() { fi } -if [ $(uci get -q env.rip.sfp) ]; then - if [ $sfp_presence == "0" ]; then - if [ $(uci get -q ethernet.eth4.wan) ] ; then +if [ "$(uci get -q env.rip.sfp)" ]; then + if [ "$sfp_presence" = "0" ]; then + if [ "$(uci get -q ethernet.eth4.wan)" ] ; then check_wan fi else diff --git a/decompressed/gui_file/www/docroot/modals/ethernet-modal.lp b/decompressed/gui_file/www/docroot/modals/ethernet-modal.lp index d6e926fb..bfb1b823 100644 --- a/decompressed/gui_file/www/docroot/modals/ethernet-modal.lp +++ b/decompressed/gui_file/www/docroot/modals/ethernet-modal.lp @@ -537,13 +537,9 @@ end local mapParSFP = {} local mapValSFP = {} -local sfpintf = "sfptag" +local sfpintf = "sfp" if sfp_presence and (sfp_presence[1].value == "1") then - --if sfptag interface not found change name to sfp (fastweb naming) - if not proxy.get("uci.network.interface.@"..sfpintf..".ipaddr") then - sfpintf = "sfp" - end mapParSFP.ethsfp = "uci.ethernet.globals.eth4lanwanmode" mapValSFP.ethsfp = vB else @@ -671,9 +667,9 @@ end local function validateLeaseTime(value, postdata, key) -- Check every possibile value... -- One tip NEVER EVER MAKE USER INSERT WORD FOR A INT VALUE... INT DON'T FUC*ING HAVE UPPER OR LOWER CHAR -.- - if value == '-1' or - value == "infinite" or - value == timhelper.ethtrans().eth_infinit or + if value == '-1' or + value == "infinite" or + value == timhelper.ethtrans().eth_infinit or value:sub(1,1):upper()..value:sub(2) == timhelper.ethtrans().eth_infinit or value:sub(1,1):lower()..value:sub(2) == timhelper.ethtrans().eth_infinit then -- included '-1' as a feasible set value as specified in TR 181 postdata[key] = "infinite" -- included to ensure uci parameter is set as infinite @@ -1428,4 +1424,4 @@ $("#btn-dhcp-reset").on("click", function(){\ \ \ '); ngx.print(ui_helper.createFooter()) ngx.print('\ -'); +');