Skip to content

Instantly share code, notes, and snippets.

@xymor
Forked from anonymous/gvt-mtu.js
Last active September 8, 2018 02:47
Show Gist options
  • Save xymor/6f93d59f0ffee23a3db71379d476723c to your computer and use it in GitHub Desktop.
Save xymor/6f93d59f0ffee23a3db71379d476723c to your computer and use it in GitHub Desktop.
script para mudar mtu do roteador GVT
//acessar 192.168.25.1/save_rg_conf.cgi
var objts = {};
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='1']/MaxMTUSize");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='1']/LowerLayers");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='2']/MaxMTUSize");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='2']/LowerLayers");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='3']/MaxMTUSize");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='3']/LowerLayers");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='4']/MaxMTUSize");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='4']/LowerLayers");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='5']/MaxMTUSize");
$.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='5']/LowerLayers");
Array.from(new Array(5), (x,i) => ++i).reduce((o, i) => {
var name = $.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='"+i+"']/LowerLayers");
var mtu = $.xmo.getValuesTree("Device/IP/Interfaces/Interface[@uid='"+i+"']/MaxMTUSize");
o[i] = {name: name, mtu: mtu};
return o;
}, {})
//setar com $.xmo.setValuesTree('1500',"Device/IP/Interfaces/Interface[@uid='5']/MaxMTUSize");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment