The myspeed.js app now installs the system service after installing

This commit is contained in:
Mathias Wagner 2023-08-04 12:46:38 +02:00
parent 2fd42c72c9
commit bbd31dc6b0
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -57,6 +57,14 @@ module.exports = {
{
description: "Abhängigkeiten installiert",
command: "cd {folder} && npm install --production"
},
{
description: "Dienst erstellt",
command: "echo -e \"[Unit]\\nDescription=MySpeed\\nAfter=network.target\\n\\n[Service]\\nType=simple\\nExecStart=/usr/bin/node server\\nRestart=always\\nUser=root\\nEnvironment=NODE_ENV=production\\nWorkingDirectory={folder}\\n\\n[Install]\\nWantedBy=multi-user.target\" > /etc/systemd/system/myspeed.service"
},
{
description: "Dienst gestartet",
command: "if command -v systemctl &> /dev/null; then systemctl daemon-reload && systemctl enable myspeed && systemctl start myspeed; fi"
}
]
}