# create user and database for openstreetmap-website
db_user_exists=`sudo -u postgres psql postgres -tAc "select 1 from pg_roles where rolname='vagrant'"`
if [ "$db_user_exists" != "1" ]; then
sudo -u postgres createuser -s vagrant
sudo -u vagrant createdb -E UTF-8 -O vagrant openstreetmap
sudo -u vagrant createdb -E UTF-8 -O vagrant osm_test
# create user and database for openstreetmap-website
db_user_exists=`sudo -u postgres psql postgres -tAc "select 1 from pg_roles where rolname='vagrant'"`
if [ "$db_user_exists" != "1" ]; then
sudo -u postgres createuser -s vagrant
sudo -u vagrant createdb -E UTF-8 -O vagrant openstreetmap
sudo -u vagrant createdb -E UTF-8 -O vagrant osm_test