Advertisement
Guest User

Untitled

a guest
Mar 24th, 2021
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. // Device ID as user name
  2. const username = declare("DeviceID.ID", {value: 1}).value[0]
  3.  
  4. // Password will be fixed a given device because Math.random() is seeded with devcie ID by default.
  5. const password = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);
  6.  
  7. const informInterval = 30;
  8.  
  9. // Refresh values daily
  10. const daily = Date.now(86400000);
  11.  
  12. // Unique inform offset per device for better load distribution
  13. const informTime = daily % 86400000;
  14.  
  15. declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: username});
  16. declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
  17. declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
  18. declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
  19. declare("InternetGatewayDevice.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});
  20.  
  21.  
  22. declare("Device.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: username});
  23. declare("Device.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
  24. declare("Device.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
  25. declare("Device.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
  26. declare("Device.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement