Skip to content

Commit

Permalink
fix: relocated to thier relative modules
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Dec 29, 2023
1 parent 0eb81e8 commit 3635e50
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 466 deletions.
69 changes: 0 additions & 69 deletions src/commands/other/certBotWildcard.js

This file was deleted.

76 changes: 0 additions & 76 deletions src/commands/other/haproxy.js

This file was deleted.

63 changes: 0 additions & 63 deletions src/commands/other/haproxyConfigManager.js

This file was deleted.

76 changes: 0 additions & 76 deletions src/commands/other/nginx.js

This file was deleted.

21 changes: 21 additions & 0 deletions src/commands/other/nginxConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,25 @@ async function deleteServer(hosts) {
return response
}

async function hasServer(hosts) {
if (!Array.isArray(hosts))
hosts = [hosts]
for (let host of hosts) {
const { stdout, stderr } = await exec(`grep -Ri 'server_name.*${host}' /etc/nginx/sites-enabled`)
if (err) {
console.error(`exec error: ${err}`);
return;
}
if (stdout) {
console.log(`Host found in the following configuration file(s):\n${stdout}`);

} else {
console.log('Host not found in Nginx configurations.');
}

if (stderr) console.error(`stderr: ${stderr}`);

}
}

module.exports = { createServer, deleteServer }
Loading

0 comments on commit 3635e50

Please sign in to comment.