mirror of
https://github.com/sakaljurgis/pvpn-transmission.git
synced 2026-07-08 20:47:41 +00:00
actually down the container
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.env
|
.env
|
||||||
|
.idea
|
||||||
|
|||||||
+8
-5
@@ -30,7 +30,8 @@ async function main() {
|
|||||||
console.log(`External ip: ${ipInfo?.ip} Country: ${ipInfo?.country}`);
|
console.log(`External ip: ${ipInfo?.ip} Country: ${ipInfo?.country}`);
|
||||||
|
|
||||||
if (!defaultInterface || !ipInfo) {
|
if (!defaultInterface || !ipInfo) {
|
||||||
console.log('Could not get default interface or ip info');
|
console.log('Could not get default interface or ip info. Shutting down transmission service');
|
||||||
|
await transmissionContainer.down();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +44,7 @@ async function main() {
|
|||||||
|
|
||||||
if (!countryOK || !internalIpOK || !externalIpOK || !interfaceOK) {
|
if (!countryOK || !internalIpOK || !externalIpOK || !interfaceOK) {
|
||||||
console.log('Shutting down transmission service');
|
console.log('Shutting down transmission service');
|
||||||
//await dockerContainer.down();
|
await transmissionContainer.down();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,14 +62,16 @@ async function main() {
|
|||||||
console.log(`Data received: ${JSON.stringify(data)}`);
|
console.log(`Data received: ${JSON.stringify(data)}`);
|
||||||
|
|
||||||
if (!data.status || !data.supported) {
|
if (!data.status || !data.supported) {
|
||||||
console.log('Could not fetch new port');
|
console.log('Could not fetch new port. Shutting down transmission service');
|
||||||
|
await transmissionContainer.down();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newPort= Number(data.status.split(" ")[1]);
|
const newPort= Number(data.status.split(" ")[1]);
|
||||||
|
|
||||||
if (!newPort) {
|
if (!newPort) {
|
||||||
console.log('Could not parse new port');
|
console.log('Could not parse new port Shutting down transmission service');
|
||||||
|
await transmissionContainer.down();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ async function main() {
|
|||||||
|
|
||||||
if (!newPortOpen) {
|
if (!newPortOpen) {
|
||||||
console.log('Port is not open, Shutting down transmission service');
|
console.log('Port is not open, Shutting down transmission service');
|
||||||
//await dockerContainer.down();
|
await transmissionContainer.down();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user