package-stuff/postinst

24 lines
582 B
Plaintext
Raw Normal View History

#!/bin/sh
2022-10-08 03:14:24 -05:00
# create the mattermost user and database
su postgres -c 'createuser mmuser'
# not sure this or the other one works
# su postgres -c 'createdb mattermost'
su postgres -c 'createdb -O mmuser mattermost'
echo
echo systemctl status mattermost.service
echo
echo 'su - postgres'
echo 'psql'
echo '\\db # will list the tablespaces'
echo '\\dg # will list users'
echo
echo "ALTER USER mmuser with password 'mmpass';"
echo
echo "CREATE DATABASE mattermost;"
echo "CREATE USER mmuser WITH PASSWORD 'mmpass';"
echo "GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;"
echo