You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
811 B

//NodeJS Script
//You must have the axios module installed
const axios = require('axios')
const querystring = require('querystring')
//Admin Credentials
const hst_hostname = 'server.hestiacp.com'
const hst_port = 8083
const hst_username = 'admin'
const hst_password = 'p4ssw0rd'
const hst_returncode = 'yes'
const hst_command = 'v-delete-user'
//Account
const username = 'demo';
const data_json = {
'user': hst_username,
'password': hst_password,
'returncode': hst_returncode,
'cmd': hst_command,
'arg1': username
}
const data = querystring.stringify(data_json)
axios.post('https://'+hst_hostname+':'+hst_port+'/api/', data)
.then(function (response) {
console.log(response.data);
console.log("0 means successful")
})
.catch(function (error) {
console.log(error);
});