403Webshell
Server IP : 104.129.129.72  /  Your IP : 216.73.216.229
Web Server : LiteSpeed
System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : answe8064 ( 1002)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/installer/services/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/installer/services/postgresql-latest-osrepo
#!/bin/bash

if [ -f "include/startup.sh" ]; then
    . include/startup.sh
elif [ -f "../include/startup.sh" ]; then
    . ../include/startup.sh
fi

rootDir=$(rootDir)

echo "Adding hostname to hosts file" | log
echo "127.0.0.1 $(hostname) localhost" > /etc/hosts

echo "Updating and installing PostGreSQL" | log
#Install postgreSQL repository
postgres_ver=$(psql -V | cut -c 19,20)

installPackage wget ca-certificates | log
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | log
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | log

apt-get update
installPackage postgresql postgresql-contrib
waitOrStop 0 "Failed apt install: postgresql"

echo "Changing PostgreSQL listening address" | log
sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/${postgres_ver}/main/postgresql.conf

echo "Starting and Enabling PostGreSQL service" | log
systemctl restart postgresql
sleep 2
waitOrStop 0 "Failed to restart postgresql"
systemctl enable postgresql

echo "Adding descriptions" | log
descriptionAppend "To connect to PostGreSQL user: sudo -i -u postgres"
descriptionAppend "To connect to PostGreSQL CLI: psql"
descriptionAppend "PostGreSQL listening port: 5432"
descriptionAppend " "

tagScript success

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit