From 3261a320c89182a04a2f037173422bb57200bd90 Mon Sep 17 00:00:00 2001 From: achi Date: Thu, 18 Jul 2024 12:15:04 +1000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D0=B8=20=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D1=83=20=D1=81=D0=BB=D1=83?= =?UTF-8?q?=D0=B6=D0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/install.ps1 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/linux/install.ps1 b/linux/install.ps1 index 042d593..43d4fc3 100644 --- a/linux/install.ps1 +++ b/linux/install.ps1 @@ -57,7 +57,9 @@ $serverExecutable = "$lersDir/Server/Lers.Server.dll" $pollServiceExecutable = "$lersDir/PollService/Lers.PollService.dll" $serverServiceName = "lers.server.service" +$serverServiceFile = "/etc/systemd/system/$serverServiceName" $pollserviceServiceName = "lers.pollservice.service" +$pollserviceServiceFile = "/etc/systemd/system/$pollserviceServiceName" ################################### # Ресурсы @@ -122,9 +124,8 @@ else $pollServiceUrl = "https://update.lers.ru/download/files/PollService.zip" } -$isServerInstalled = Test-Path -Path $serverExecutable -$isPollServiceInstalled = Test-Path -Path $pollServiceExecutable - +$isServerInstalled = Test-Path -Path $serverServiceFile +$isPollServiceInstalled = Test-Path -Path $pollserviceServiceFile ## Останавливаем запущенные службы, если они есть @@ -262,11 +263,25 @@ else if ($server) { - $serverSystemd | Set-Content /etc/systemd/system/$serverServiceName -Force + $serverSystemd | Set-Content $serverServiceFile -Force } if ($pollservice) { - $pollserviceSystemd | Set-Content /etc/systemd/system/$pollserviceServiceName -Force + $pollserviceSystemd | Set-Content $pollserviceServiceFile -Force } } + +# Запускаем службы + +systemctl daemon-reload + +if ($isServerInstalled) +{ + systemctl start $serverServiceName +} + +if ($isPollServiceInstalled) +{ + systemctl start $pollserviceServiceName +}