Skip to content

Commit b3020f7

Browse files
authored
Merge pull request firewalla#1452 from drahnieR/upnp
remove upnp lease file on turning off
2 parents f3f04f6 + 453cfda commit b3020f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/upnp/upnp_plugin.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ class UPnPPlugin extends Plugin {
8383
const allowNetworks = internalNetworks.map(n => `allow 1024-65535 ${n} 1024-65535`);
8484
content = content.replace(/%ALLOW_NETWORK%/g, allowNetworks.join("\n"));
8585
await fs.writeFileAsync(this._getConfigFilePath(), content, {encoding: 'utf8'});
86+
87+
// delete lease file on turning off
88+
if (!upnpEnabled) {
89+
await exec(`sudo rm /var/run/upnp.${this.name}.leases`)
90+
}
8691
}
8792

8893
async apply() {

0 commit comments

Comments
 (0)