package-stuff/postinst

21 lines
493 B
Bash
Executable File

#!/bin/sh
# create the mattermost user and database
su postgres -c 'createdb mattermost'
su postgres -c 'createuser mmuser'
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