mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
Add database and database users sync (#537)
* Add database and database users sync * get mysl users * add mariadb and postgres * fix phpstan
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
if ! sudo -u postgres psql -c "SELECT r.rolname AS username,
|
||||
'' as host,
|
||||
STRING_AGG(d.datname, ',') AS databases
|
||||
FROM pg_roles r
|
||||
JOIN
|
||||
pg_database d ON has_database_privilege(r.rolname, d.datname, 'CONNECT')
|
||||
WHERE r.rolcanlogin
|
||||
GROUP BY r.rolname
|
||||
ORDER BY r.rolname;";
|
||||
then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
Reference in New Issue
Block a user