403Webshell
Server IP : 189.126.111.107  /  Your IP : 216.73.217.69
Web Server : Apache
System : Linux www.gadotticar.com.br 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64
User : gadotticar ( 1000)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/src/fusionpbx-install.sh/windows/resources/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/fusionpbx-install.sh/windows/resources/install-postgresql.ps1
Function Install-PostgreSQL() {

	. .\resources\get-file.ps1
	. .\resources\get-database_password.ps1
	. .\resources\start-pgsql.ps1
    . .\resources\get-installed-app.ps1

	if (Get-Installed-App "PostgreSQL*") {
		Write-Host PostgreSQL is already installed
		return
	}
	if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
		$url = "https://get.enterprisedb.com/postgresql/postgresql-10.1-3-windows.exe"
	}
	else {
		$url = "https://get.enterprisedb.com/postgresql/postgresql-10.1-3-windows-x64.exe"
	}

	Write-Host Download PostgreSQL from $url -ForegroundColor Cyan
	$filename = Get-File $url
	Write-Host Install Postgresql -ForegroundColor Cyan

	Start-Process $filename "--mode unattended --superpassword $database_password" -Wait
	#Get-Service postgre*

	Write-Host "Create the database and users" -ForegroundColor Cyan
	Start-PSQL "CREATE DATABASE fusionpbx;";
	Start-PSQL "CREATE DATABASE freeswitch;";
	Start-PSQL "CREATE ROLE fusionpbx WITH SUPERUSER LOGIN PASSWORD '$database_password';"
	Start-PSQL "CREATE ROLE freeswitch WITH SUPERUSER LOGIN PASSWORD '$database_password';"
	Start-PSQL "GRANT ALL PRIVILEGES ON DATABASE fusionpbx to fusionpbx;"
	Start-PSQL "GRANT ALL PRIVILEGES ON DATABASE freeswitch to fusionpbx;"
	Start-PSQL "GRANT ALL PRIVILEGES ON DATABASE freeswitch to freeswitch;"
	
	#move pg_hba.conf
    	Move-Item "C:\Program Files\PostgreSQL\10\data\pg_hba.conf" "C:\Program Files\PostgreSQL\10\data\BAK_pg_hba.conf"
    	Copy-Item ".\resources\postgresql\pg_hba.conf" "C:\Program Files\PostgreSQL\10\data\" -recurse

    	#reload 
    	C:\Windows\system32\cscript.exe //NoLogo "C:\Program Files\PostgreSQL\10\scripts\serverctl.vbs" reload
	
}

Youez - 2016 - github.com/yon3zu
LinuXploit