|
30 | 30 | from lib.common.rand import random_integer, random_string |
31 | 31 |
|
32 | 32 | log = logging.getLogger(__name__) |
33 | | -PERSISTENT_ROUTE_GATEWAY = "192.168.1.1" |
34 | 33 | si = subprocess.STARTUPINFO() |
35 | 34 | si.dwFlags |= subprocess.STARTF_USESHOWWINDOW |
36 | 35 |
|
@@ -243,18 +242,14 @@ def randomizeUUID(self): |
243 | 242 | # Replace the UUID with the new UUID |
244 | 243 | SetValueEx(key, "MachineGuid", 0, REG_SZ, createdUUID) |
245 | 244 |
|
246 | | - def add_persistent_route(self): |
247 | | - self.run_as_system( |
248 | | - ["C:\\Windows\\System32\\ROUTE.exe", "-p", "add", "0.0.0.0", "mask", "0.0.0.0", PERSISTENT_ROUTE_GATEWAY] |
249 | | - ) |
250 | | - self.run_as_system( |
251 | | - ["C:\\Windows\\System32\\ROUTE.exe", "-p", "change", "0.0.0.0", "mask", "0.0.0.0", PERSISTENT_ROUTE_GATEWAY] |
252 | | - ) |
| 245 | + def add_persistent_route(self, gateway: str): |
| 246 | + self.run_as_system(["C:\\Windows\\System32\\ROUTE.exe", "-p", "add", "0.0.0.0", "mask", "0.0.0.0", gateway]) |
| 247 | + self.run_as_system(["C:\\Windows\\System32\\ROUTE.exe", "-p", "change", "0.0.0.0", "mask", "0.0.0.0", gateway]) |
253 | 248 |
|
254 | 249 | def start(self): |
255 | 250 | if self.config.windows_static_route: |
256 | 251 | log.info(f"Config for route is: {str(self.config.windows_static_route)}") |
257 | | - self.add_persistent_route() |
| 252 | + self.add_persistent_route(self.config.windows_static_route_gateway) |
258 | 253 | self.change_productid() |
259 | 254 | self.set_office_mrus() |
260 | 255 | self.ramnit() |
|
0 commit comments