From fb053d9897b7b75cdee013b19bdf0ab48ad3dad7 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 4 Nov 2023 15:35:46 +0100 Subject: [PATCH] Version 0.3.2 - Fix of Services --- bin/services.js | 72 ++++++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bin/services.js b/bin/services.js index 8ea56a5..4449405 100644 --- a/bin/services.js +++ b/bin/services.js @@ -42,24 +42,24 @@ module.exports.stopService = function(service) { return new Promise((resolve, reject) => { const child_process = require('child_process'); - if(service == "https://subsonics.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 stop 'Subsonics'") + if(service == `https://subsonics.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 stop "Subsonics"'`) resolve("OK") - } else if(service == "https://git.raphix.fr" ) { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl stop gitea") + } else if(service == `https://git.raphix.fr` ) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl stop gitea`) resolve("OK") - } else if(service == "https://jenkins.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl stop jenkins ") + } else if(service == `https://jenkins.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl stop jenkins `) resolve("OK") - } else if(service == 'https://raphix.fr') { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 stop 'Website - Raphix'") + } else if(service == `https://raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 stop "Website - Raphix"'`) resolve("OK") - } else if(service == "https://cv.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 stop 'CV - Raphael'") + } else if(service == `https://cv.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 stop "CV - Raphael"'`) resolve("OK") - } else if(service == "http://omega.raphix.fr:2333") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl stop lavalink ") + } else if(service == `http://omega.raphix.fr:2333`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl stop lavalink `) resolve("OK") } else { resolve(false) @@ -75,25 +75,25 @@ module.exports.startService = function(service) { return new Promise((resolve, reject) => { const child_process = require('child_process'); - if(service == "https://subsonics.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 start /home/gitlab-ci/subsonic.config.js") + if(service == `https://subsonics.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 start /home/gitlab-ci/subsonic.config.js'`) resolve("OK") - } else if(service == "https://git.raphix.fr" ) { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl start gitea") + } else if(service == `https://git.raphix.fr` ) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl start gitea`) resolve("OK") - } else if(service == "https://jenkins.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl start jenkins ") + } else if(service == `https://jenkins.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl start jenkins `) resolve("OK") - } else if(service == 'https://raphix.fr') { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 start /home/gitlab-ci/website.config.js") + } else if(service == `https://raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 start /home/gitlab-ci/website.config.js'`) resolve("OK") - } else if(service == "https://cv.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 start /home/gitlab-ci/cv.config.js") + } else if(service == `https://cv.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 start /home/gitlab-ci/cv.config.js'`) resolve("OK") - } else if(service == "http://omega.raphix.fr:2333") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl start lavalink ") + } else if(service == `http://omega.raphix.fr:2333`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl start lavalink `) resolve("OK") } else { resolve(false) @@ -109,24 +109,24 @@ module.exports.restartService = function(service) { return new Promise((resolve, reject) => { const child_process = require('child_process'); - if(service == "https://subsonics.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 restart 'Subsonics'") + if(service == `https://subsonics.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 restart "Subsonics"'`) resolve("OK") - } else if(service == "https://git.raphix.fr" ) { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl restart gitea") + } else if(service == `https://git.raphix.fr` ) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl restart gitea`) resolve("OK") - } else if(service == "https://jenkins.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl restart jenkins ") + } else if(service == `https://jenkins.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl restart jenkins `) resolve("OK") - } else if(service == 'https://raphix.fr') { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 restart 'Website - Raphix'") + } else if(service == `https://raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 restart "Website - Raphix"'`) resolve("OK") - } else if(service == "https://cv.raphix.fr") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci pm2 restart 'CV - Raphael'") + } else if(service == `https://cv.raphix.fr`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr sudo -S -u gitlab-ci 'pm2 restart "CV - Raphael"'`) resolve("OK") - } else if(service == "http://omega.raphix.fr:2333") { - let req = child_process.exec("ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl restart lavalink ") + } else if(service == `http://omega.raphix.fr:2333`) { + let req = child_process.exec(`ssh -o StrictHostKeyChecking=no raphix@omega.raphix.fr sudo -S systemctl restart lavalink `) resolve("OK") } else { resolve(false) diff --git a/package.json b/package.json index 99cbb02..ab54ce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neutral", - "version": "0.3.1", + "version": "0.3.2", "description": "Panel d'administration de Raphix", "main": "index.js", "scripts": {