Commit fdb36d2 1 parent 7e66e3c commit fdb36d2 Copy full SHA for fdb36d2
File tree 2 files changed +15
-16
lines changed
usr/share/transformer/scripts
2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -23,28 +23,31 @@ check_wan() {
23
23
}
24
24
25
25
set_sfp () {
26
- if [ $sfp_wanlan_mode == " 1" ]; then
26
+
27
+ # this is to forcely use network.sfp otherwise /usr/sbin/sfp_get.sh will use network.sfptag that is managed by nothing
28
+ [ " $( uci get -q network.sfptag) " ] && uci delete network.sfptag
29
+
30
+ if [ " $sfp_wanlan_mode " = " 0" ]; then
27
31
if [ ! " $( uci get -q network.lan.ifname | grep eth4) " ]; then
28
32
uci set network.lan.ifname=' eth0 eth1 eth2 eth3 eth4 eth5'
29
- uci set network.sfptag.ifname=' '
30
33
uci commit
31
34
/etc/init.d/network restart
32
35
/etc/init.d/ethernet reload
33
36
fi
34
37
else
35
- if [ ! " $( uci get -q network.sfptag .ifname | grep eth4) " ]; then
38
+ if [ ! " $( uci get -q network.sfp .ifname | grep eth4) " ]; then
36
39
uci set network.lan.ifname=' eth0 eth1 eth2 eth3 eth5'
37
- uci set network.sfptag .ifname=' eth4'
40
+ uci set network.sfp .ifname=' eth4'
38
41
uci commit
39
42
/etc/init.d/network restart
40
43
/etc/init.d/ethernet reload
41
44
fi
42
45
fi
43
46
}
44
47
45
- if [ $( uci get -q env.rip.sfp) ]; then
46
- if [ $sfp_presence = = " 0" ]; then
47
- if [ $( uci get -q ethernet.eth4.wan) ] ; then
48
+ if [ " $( uci get -q env.rip.sfp) " ]; then
49
+ if [ " $sfp_presence " = " 0" ]; then
50
+ if [ " $( uci get -q ethernet.eth4.wan) " ] ; then
48
51
check_wan
49
52
fi
50
53
else
Original file line number Diff line number Diff line change 537
537
local mapParSFP = {}
538
538
local mapValSFP = {}
539
539
540
- local sfpintf = "sfptag "
540
+ local sfpintf = "sfp "
541
541
542
542
if sfp_presence and (sfp_presence[1].value == "1") then
543
- --if sfptag interface not found change name to sfp (fastweb naming)
544
- if not proxy.get("uci.network.interface.@"..sfpintf..".ipaddr") then
545
- sfpintf = "sfp"
546
- end
547
543
mapParSFP.ethsfp = "uci.ethernet.globals.eth4lanwanmode"
548
544
mapValSFP.ethsfp = vB
549
545
else
671
667
local function validateLeaseTime(value, postdata, key)
672
668
-- Check every possibile value...
673
669
-- One tip NEVER EVER MAKE USER INSERT WORD FOR A INT VALUE... INT DON'T FUC*ING HAVE UPPER OR LOWER CHAR -.-
674
- if value == '-1' or
675
- value == "infinite" or
676
- value == timhelper.ethtrans().eth_infinit or
670
+ if value == '-1' or
671
+ value == "infinite" or
672
+ value == timhelper.ethtrans().eth_infinit or
677
673
value:sub(1,1):upper()..value:sub(2) == timhelper.ethtrans().eth_infinit or
678
674
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
679
675
postdata[key] = "infinite" -- included to ensure uci parameter is set as infinite
@@ -1428,4 +1424,4 @@ $("#btn-dhcp-reset").on("click", function(){\
1428
1424
</script>\
1429
1425
\
1430
1426
'); ngx.print(ui_helper.createFooter()) ngx.print('\
1431
- ');
1427
+ ');
You can’t perform that action at this time.
0 commit comments