added inital isntall for gmg, no configfile yet
[fai-configs.git] / scripts / YOURLS / 10_download_yourls.sh
1 #! /bin/bash
2
3 YOURLS_VERS='1.7.1'
4
5 # Download yourls and install; we're going to be doing this under the gnusocial user.
6 if ! $ROOTCMD getent passwd gnusocial ; then
7 $ROOTCMD adduser --system --ingroup www-data --disabled-password --gecos "gnusocial user" gnusocial
8 fi
9
10 if ! $ROOTCMD test -e /home/gnusocial/.ssh/id_rsa; then
11 $ROOTCMD echo | $ROOTCMD sudo -u gnusocial ssh-keygen -N ''
12 fi
13
14 if ! $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/
19 fi