-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart-server.ps1
More file actions
26 lines (21 loc) · 845 Bytes
/
Copy pathstart-server.ps1
File metadata and controls
26 lines (21 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# AccessClone Server Startup Script
param(
[string]$Password = "<password>",
[int]$Port = 3001
)
Write-Host "AccessClone Server" -ForegroundColor Cyan
Write-Host "=================" -ForegroundColor Cyan
# Kill existing server on this port
Write-Host "Checking for existing server on port $Port..." -ForegroundColor Yellow
Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty OwningProcess -Unique |
ForEach-Object {
Write-Host "Stopping process PID: $_" -ForegroundColor Yellow
Stop-Process -Id $_ -Force -ErrorAction SilentlyContinue
}
Start-Sleep -Milliseconds 500
# Set environment and start server
Write-Host "Starting server..." -ForegroundColor Yellow
$env:PGPASSWORD = $Password
Set-Location $PSScriptRoot\server
npm start