-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (25 loc) · 1.01 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// https://code.i-harness.com/de/q/683f2e
// https://www.dev2qa.com/node-js-read-write-file-examples/
// https://www.npmjs.com/package/simple-ssh
var ssh = require('./ssh');
// Create Object for Ssh Client Connection
var ssh_client = require('simple-ssh');
var auth_default = require('./auth/default');
var server = new ssh_client(auth_default.ssh);
function plesco(cmds) {
ssh.sshExecute(server, cmds, console.log.bind(console));
}
function plescodom(cmds, domain) {
var domains_cmds = plesk.getCommandsOnDomain(cmds, domain);
console.log(domains_cmds);
ssh.sshExecute(server, domains_cmds, console.log.bind(console));
}
plescodom([
'ls /etc/apache2/plesk.conf.d/webmails/',
'rm /etc/apache2/plesk.conf.d/webmails/{domain}_webmail.conf',
'rm /etc/apache2/plesk.conf.d/webmails/{domain}_webmail.conf',
'rm /etc/apache2/plesk.conf.d/vhosts/{domain}.conf',
'rm /etc/nginx/plesk.conf.d/vhosts/{domain}.conf',
'plesk repair web {domain} -y'
],
'domain1.pl');