initial commit of file from CVS for smeserver-phppgadmin on Sat Sep 7 20:53:08 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:53:08 +10:00
parent 9692a5d986
commit 968f65d84e
20 changed files with 1131 additions and 2 deletions

View 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