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 +}