Fix permissions
[fai-configs.git] / scripts / YOURLS / 10_download_yourls.sh
CommitLineData
a61f964b
JD
1#! /bin/bash
2
3YOURLS_VERS='1.7.1'
4
5# Download yourls and install; we're going to be doing this under the gnusocial user.
6if ! $ROOTCMD getent passwd gnusocial ; then
7 $ROOTCMD adduser --system --ingroup www-data --disabled-password --gecos "gnusocial user" gnusocial
8fi
9
10if ! $ROOTCMD test -e /home/gnusocial/.ssh/id_rsa; then
11 $ROOTCMD echo | $ROOTCMD sudo -u gnusocial ssh-keygen -N ''
12fi
13
14if ! $ROOTCMD echo | cd /home/gnusocial/
15 mkdir /var/www/yourls
16 curl https://codeload.github.com/YOURLS/YOURLS/tar.gz/$YOURLS_VERS -o /home/gnusocial/yourls.tar.gz; then
17 tar xf /home/gnusocial/yourls.tar.gz -C /home/gnusocial/
18 mv /home/gnusocial/YOURLS-$YOURLS_VERS/* /var/www/yourls/
19fi