mirror of
https://git.coastit.co.za/caitlin/CRM_ENVR.git
synced 2026-07-10 11:15:43 +02:00
Added 4 Demo Users, with Coast emails, Hierarchy, roles etc.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
$pgDir = "$env:TEMP\pg\pgsql"
|
||||
$pgData = "$env:TEMP\pg\data"
|
||||
$pgBin = "$pgDir\bin"
|
||||
$logFile = "$env:TEMP\pg\logfile"
|
||||
|
||||
if (-not (Test-Path "$pgData\postgresql.conf")) {
|
||||
Write-Error "PostgreSQL not initialized. Run initdb first."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$running = $null -ne (Get-Process -Name "postgres" -ErrorAction SilentlyContinue)
|
||||
$listening = $null -ne (netstat -ano -p TCP 2>$null | Select-String ":5432.*LISTENING")
|
||||
|
||||
if (-not $running -or -not $listening) {
|
||||
$existing = Get-Process -Name "postgres" -ErrorAction SilentlyContinue
|
||||
if ($existing) { $existing | Stop-Process -Force }
|
||||
Start-Sleep -Seconds 1
|
||||
Remove-Item "$pgData\postmaster.pid" -Force -ErrorAction SilentlyContinue
|
||||
$env:PATH = "$pgBin;$env:PATH"
|
||||
Start-Process -FilePath "$pgBin\postgres.exe" -ArgumentList "-D `"$pgData`"" -WindowStyle Hidden
|
||||
Start-Sleep -Seconds 3
|
||||
Write-Output "PostgreSQL started."
|
||||
} else {
|
||||
Write-Output "PostgreSQL already running on port 5432."
|
||||
}
|
||||
Reference in New Issue
Block a user