added instance sftp port

This commit is contained in:
2026-02-13 12:51:45 +01:00
parent 11f3d01a55
commit ebf5479250
+15 -2
View File
@@ -97,7 +97,6 @@ async function main() {
const upnpPortList = run('upnpc -l');
// console.log(upnpPortList);
for (const instance of JSON.parse(instancesJSON)) {
if (instance.DeploymentArgs['GenericModule.App.Ports'] != undefined) {
// 0 - TCP; 1 = UDP; 2 - Both
@@ -147,8 +146,22 @@ async function main() {
}
}
}
}
if (instance.DeploymentArgs['FileManagerPlugin.SFTP.SFTPPortNumber'] != undefined) {
let Name = `AMP ${instance.FriendlyName} SFTP`;
let Number = instance.DeploymentArgs['FileManagerPlugin.SFTP.SFTPPortNumber'];
instancesPorts += `${Name}\n`;
if (!upnpPortList.includes(Name)) {
try {
run(`upnpc -e "${Name}" -a ${config.ip} ${Number} ${Number} TCP`);
console.log(`Port added: "${Name}" ${Number} TCP`);
} catch (error) {
console.log(`Port failed: "${Name}" ${Number} TCP`);
}
}
}
}
// Delete all AMP
// for (const portMap of upnpPortList.split('\n')) {
// if (portMap.includes("AMP")) {