Commit c0d752e1 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 314154f3
const {Client} = require('pg')
let _ = require('lodash')
const fs = require('fs');
var ps = require('ps-node');
const shellExec = require('shell-exec')
const cron = require('node-cron');
const cronKill = require('node-cron');
const express = require('express')
const app = express()
const port = 3000
......@@ -58,7 +60,7 @@ async function refresh() {
arr = _.uniq(arr);
let last = '78.47.222.24.sslip.io : RSA "privkey.pem"' + '\n'
let last = 'test.vpsl.xyz : RSA "privkey.pem"' + '\n'
for (let i = 0; i < arr.length; i++)
last += arr[i] + '\n'
......@@ -98,6 +100,21 @@ function createfile(data) {
});
}
function kill() {
ps.kill('1', function (err) {
if (err) {
throw new Error(err);
} else {
console.log('Process %s has been killed!', 1);
}
});
}
cronKill.schedule('*/60 * * * * *', () => {
kill()
});
async function execLast() {
let d = await shellExec('ipsec secrets')
return true
......
......@@ -53,9 +53,9 @@
</dict>
</array>
<key>RemoteAddress</key>
<string>78.47.222.24.sslip.io</string>
<string>test.vpsl.xyz</string>
<key>RemoteIdentifier</key>
<string>78.47.222.24.sslip.io</string>
<string>test.vpsl.xyz</string>
<key>UseConfigurationAttributeInternalIPSubnet</key>
<integer>0</integer>
</dict>
......@@ -69,11 +69,11 @@
<key>PayloadDisplayName</key>
<string>VPN</string>
<key>PayloadIdentifier</key>
<string>com.apple.vpn.managed.1a5787e5-2493-472b-b5e6-d39f66fd494b</string>
<string>com.apple.vpn.managed.a6fbd41d-4e43-4f8d-a804-3ca92f891aa8</string>
<key>PayloadType</key>
<string>com.apple.vpn.managed</string>
<key>PayloadUUID</key>
<string>0ec253bc-a277-4c64-a07e-bb0bcbdc98e8</string>
<string>85700271-ce73-45ab-9278-91d5862383ef</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>Proxies</key>
......@@ -84,7 +84,7 @@
<integer>0</integer>
</dict>
<key>UserDefinedName</key>
<string>VPSL IKEv2</string>
<string>VPSL</string>
<key>VPNType</key>
<string>IKEv2</string>
</dict>
......@@ -92,13 +92,13 @@
<key>PayloadDisplayName</key>
<string>IKEv2 VPN configuration (VPSL)</string>
<key>PayloadIdentifier</key>
<string>com.mackerron.vpn.09a6a03c-78bd-42be-a4cc-2dc61c770806</string>
<string>com.mackerron.vpn.f54c9931-0d94-4ffd-9f9f-792b53c23ffc</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>dae13c80-7d77-4fe6-ab9c-1fb282255b9c</string>
<string>9817c47e-36c1-4dec-a765-eb2adf0a01f5</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment