Avancement dans les scripts d'installation de Mastodon

This commit is contained in:
2018-05-06 23:32:22 +02:00
parent fef3b00193
commit c1aebe3913
5 changed files with 72 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
#!/bin/bash
# https://anystack.xyz/how-to-install-mastodon-ubuntu/
set -x
# Check if it is a Ubuntu host
@@ -16,26 +17,35 @@ fi
if true; then
adduser --disabled-password --disabled-login --gecos "" mastodon || exit 3
chmod +r Install*.sh;chmod +x Install*.sh
cp Install-Mastodon-Phase3.sh Install-Mastodon-Phase4.sh /home/mastodon || exit 4
chown -R mastodon /home/mastodon || exit 5
chmod +x /home/mastodon/Install*.sh
if [ -e ./Install-Mastodon-CreatePSQL-User.sh ]
then
# Creation de l'utilisateur Postgresql postgres
su - postgres -C ./Install-Mastodon-CreatePSQL-User.sh || exit 6
cp -f Install-Mastodon-CreatePSQL-User.sh /tmp || exit 6
chmod 644 /tmp/Install*.sh
chmod +x /tmp/Install*.sh || exit 7
su - postgres -c /tmp/Install-Mastodon-CreatePSQL-User.sh || exit 8
rm -f /tmp/Install*.sh
else
exit 7
exit 9
fi
fi
sed -i '/^local.*postgres.*peer$/a host all all 127.0.0.1/32 ident' /etc/postgresql/9.?/main/pg_hba.conf || exit 3
apt-get -y install pidentd && sudo systemctl enable pidentd && sudo systemctl start pidentd || exit 4
systemctl restart postgresql || exit 5
apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev || exit 6
apt-get install -y libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev || exit 7
apt-get install -y libgdbm3 libgdbm-dev || exit 8
if true; then
sed -i '/^local.*postgres.*peer$/a host all all 127.0.0.1/32 ident' /etc/postgresql/9.?/main/pg_hba.conf || exit 10
apt-get -y install pidentd || exit 11
systemctl enable pidentd || exit 12
systemctl start pidentd || exit 13
systemctl restart postgresql || exit 14
apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev || exit 15
apt-get install -y libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev || exit 16
apt-get install -y libgdbm3 libgdbm-dev || exit 17
fi
cp Install-Mastodon-Phase3.sh Install-Mastodon-Phase4.sh /home/mastodon || exit 10
chown -R mastodon:mastodon /home/mastodon || exit 11
su - mastodon -C Install-Mastodon-Phase3.sh || exit 12
su - mastodon -C Install-Mastodon-Phase4.sh || exit 13
if true; then
su - mastodon -c ./Install-Mastodon-Phase3.sh || exit 18
su - mastodon -c ./Install-Mastodon-Phase4.sh || exit 19
fi