mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
add postgresql (#118)
This commit is contained in:
10
app/SSH/Services/Database/scripts/postgresql/unlink.sh
Executable file
10
app/SSH/Services/Database/scripts/postgresql/unlink.sh
Executable file
@ -0,0 +1,10 @@
|
||||
USER_TO_REVOKE='__username__'
|
||||
|
||||
DATABASES=$(sudo -u postgres psql -t -c "SELECT datname FROM pg_database WHERE datistemplate = false;")
|
||||
|
||||
for DB in $DATABASES; do
|
||||
echo "Revoking privileges in database: $DB"
|
||||
sudo -u postgres psql -d "$DB" -c "REVOKE ALL PRIVILEGES ON DATABASE \"$DB\" FROM $USER_TO_REVOKE;"
|
||||
done
|
||||
|
||||
echo "Privileges revoked from $USER_TO_REVOKE"
|
Reference in New Issue
Block a user