From 9b26c342e146500b5d58b222f89957ac74c7c7d8 Mon Sep 17 00:00:00 2001 From: achi Date: Thu, 18 Jul 2024 12:21:25 +1000 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D1=81=D0=BB?= =?UTF-8?q?=D1=83=D0=B6=D0=B1=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/install.ps1 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/linux/install.ps1 b/linux/install.ps1 index 43d4fc3..3433ea6 100644 --- a/linux/install.ps1 +++ b/linux/install.ps1 @@ -124,17 +124,15 @@ else $pollServiceUrl = "https://update.lers.ru/download/files/PollService.zip" } -$isServerInstalled = Test-Path -Path $serverServiceFile -$isPollServiceInstalled = Test-Path -Path $pollserviceServiceFile ## Останавливаем запущенные службы, если они есть -if ($isServerInstalled) +if (Test-Path -Path $serverServiceFile) { systemctl stop $serverServiceName } -if ($isPollServiceInstalled) +if (Test-Path -Path $pollserviceServiceFile) { systemctl stop $pollserviceServiceName } @@ -144,8 +142,8 @@ if ($update) # В режиме обновления игнорируем ключи -server и -pollservice # Вместо этого по наличию файлов определяем установлены ли сервер и служба опроса - $server = $isServerInstalled - $pollservice = $isPollServiceInstalled + $server = Test-Path -Path $serverExecutable + $pollservice = Test-Path -Path $pollServiceExecutable } elseif (-not $server -and -not $pollservice) { @@ -276,12 +274,12 @@ else systemctl daemon-reload -if ($isServerInstalled) +if (Test-Path -Path $serverServiceFile) { systemctl start $serverServiceName } -if ($isPollServiceInstalled) +if (Test-Path -Path $pollserviceServiceFile) { systemctl start $pollserviceServiceName }