Skip to content

Commit 3635e50

Browse files
committed
fix: relocated to thier relative modules
1 parent 0eb81e8 commit 3635e50

6 files changed

Lines changed: 21 additions & 466 deletions

File tree

src/commands/other/certBotWildcard.js

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/commands/other/haproxy.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/commands/other/haproxyConfigManager.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/commands/other/nginx.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/commands/other/nginxConfigManager.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,25 @@ async function deleteServer(hosts) {
107107
return response
108108
}
109109

110+
async function hasServer(hosts) {
111+
if (!Array.isArray(hosts))
112+
hosts = [hosts]
113+
for (let host of hosts) {
114+
const { stdout, stderr } = await exec(`grep -Ri 'server_name.*${host}' /etc/nginx/sites-enabled`)
115+
if (err) {
116+
console.error(`exec error: ${err}`);
117+
return;
118+
}
119+
if (stdout) {
120+
console.log(`Host found in the following configuration file(s):\n${stdout}`);
121+
122+
} else {
123+
console.log('Host not found in Nginx configurations.');
124+
}
125+
126+
if (stderr) console.error(`stderr: ${stderr}`);
127+
128+
}
129+
}
130+
110131
module.exports = { createServer, deleteServer }

0 commit comments

Comments
 (0)