package-stuff/mattermost/postinst

24 lines
582 B
Bash
Executable File

#!/bin/sh
# 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