aboutsummaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authornemsia <nemsia@nemsia.org>2017-04-11 11:39:46 +0200
committerGitHub <noreply@github.com>2017-04-11 11:39:46 +0200
commitc893f503ab2dc6975b8ca582d0f9b7e914f2a447 (patch)
treeaab68a843f4f44fff8268fd19555cbffc79121b3 /scripts/install
parenta91a1fa199b4a346335b67fc7ae97185e4ff7a77 (diff)
downloadmastodon_ynh-c893f503ab2dc6975b8ca582d0f9b7e914f2a447.tar.gz
mastodon_ynh-c893f503ab2dc6975b8ca582d0f9b7e914f2a447.tar.bz2
mastodon_ynh-c893f503ab2dc6975b8ca582d0f9b7e914f2a447.zip
Change pg encoding, again ...
Diffstat (limited to 'scripts/install')
-rw-r--r--scripts/install20
1 files changed, 7 insertions, 13 deletions
diff --git a/scripts/install b/scripts/install
index 73e70a2..9f3103c 100644
--- a/scripts/install
+++ b/scripts/install
@@ -65,21 +65,15 @@ curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get -y install nodejs
sudo npm install -g yarn
-# Create DB without password
-# sudo systemctl restart postgresql
-# ynh_psql_create_db_without_password "$app"
-# Don't work
+# Create DB user
+ynh_psql_create_user "$app"
# Create user mastodon and set UTF8 encoding by default
-sudo su - postgres
-psql
-CREATE USER mastodon CREATEDB;
-update pg_database set datistemplate='false' where datname='template1';
-drop database template1;
-create database template1 encoding='UTF8' template template0;
-update pg_database set datistemplate='true' where datname='template1';
-\q
-exit
+sudo su -c "psql" postgres <<< \
+ "update pg_database set datistemplate='false' where datname='template1';"\
+ "drop database template1;"\
+ "create database template1 encoding='UTF8' template template0;"\
+ "update pg_database set datistemplate='true' where datname='template1';
# Download all Ruby source
sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv