Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let location = null;
- let model = null;
- let serial = null;
- let igd = declare("VirtualParameters.location", {value: 1});
- const now = Date.now();
- if (igd.size) {
- for (let p of igd) {
- if (p.value[0]) {
- location = p.value[0];
- break;
- }
- }
- }
- if (!location) {
- log("No location, exiting");
- return;
- }
- igd = declare("InternetGatewayDevice.DeviceInfo.ModelName", {value: 1});
- if (igd.size) {
- for (let p of igd) {
- if (p.value[0]) {
- model = p.value[0];
- break;
- }
- }
- }
- if (!model) {
- log("No model. This should never happen");
- return;
- }
- switch (location) {
- case 'Wasilla':
- switch (model) {
- case 'SR515ac':
- log('Adding static route to ' + location + ' for ' + model);
- let foo = declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*", null, {path: 1});
- log('Foo: ' + Object.keys(foo).join(', '));
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.DestIPAddress", {value: now}, {value: '192.168.7.80'});
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.GatewayIPAddress", {value: now}, {value: '172.27.240.1'});
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.ForwardingPolicy", {value: now}, {value: -1});
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.ForwardingMetric", {value: now}, {value: -1});
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.Interface", {value: now}, {value: 'atm1.1'});
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.DestSubnetMask", {value: now}, {value: '255.255.255.255'});
- declare("InternetGatewayDevice.Layer3Forwarding.Forwarding.*.Enable", {value: now}, {value: true});
- break;
- default:
- log('Unknown model: ' + model + ', location: ' + location);
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement