initial commit of file from CVS for smeserver-phppgadmin on Sat Sep 7 20:53:08 AEST 2024
This commit is contained in:
12
root/etc/e-smith/events/actions/smeserver-phpPgAdmin-conf
Normal file
12
root/etc/e-smith/events/actions/smeserver-phpPgAdmin-conf
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
psql='/usr/pgsql-13/bin/psql'
|
||||
password=`/sbin/e-smith/db configuration getprop phppgadmin Password || echo "changeme"`
|
||||
admin=`sudo -Hiu postgres $psql -tAc "SELECT 1 FROM pg_roles WHERE rolname='admin'"`
|
||||
if [[ $admin -ne '1' ]];then
|
||||
# sudo -Hiu postgres $psql -c "CREATE USER admin CREATEDB CREATEUSER CREATEROLE ENCRYPTED PASSWORD '$password';"
|
||||
sudo -Hiu postgres $psql -c "CREATE USER admin CREATEDB CREATEROLE ENCRYPTED PASSWORD '$password';"
|
||||
else
|
||||
sudo -Hiu postgres $psql -c "ALTER USER admin WITH PASSWORD '$password';"
|
||||
exit 0
|
||||
fi
|
Reference in New Issue
Block a user