Commit a18a4a7f authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent cfe975aa
...@@ -72,14 +72,17 @@ cronRemover.schedule(' */1 * * * *', () => { ...@@ -72,14 +72,17 @@ cronRemover.schedule(' */1 * * * *', () => {
async function remover() { async function remover() {
let work = await getWork() let work = await getWork()
if (work === 'true') if (work === 'false') {
return true let ip = await getIp()
let ip = await getIp() console.log(ip)
console.log(ip) var contents = await fs.readFileSync('./token.txt', 'utf8');
var contents = await fs.readFileSync('./token.txt', 'utf8'); let Hetzner = require('./Hetzner')
let Hetzner = require('./Hetzner') let het = new Hetzner(contents)
let het = new Hetzner(contents) await het.removeByIp(ip)
await het.removeByIp(ip) }
return true
} }
...@@ -123,7 +126,7 @@ function getIp() { ...@@ -123,7 +126,7 @@ function getIp() {
} }
function postRequest() { function postRequest() {
let data = {generation: generation, groups: groups} let data = {generation: generation, groups: groups}
data = JSON.stringify(data) data = JSON.stringify(data)
data = cryptLib.encryptPlainTextWithRandomIV(data, key) data = cryptLib.encryptPlainTextWithRandomIV(data, key)
......
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