Add yourls support
authorJohn Dulaney <jdulaney@fedoraproject.org>
Wed, 16 Dec 2015 00:02:12 +0000 (19:02 -0500)
committerJohn Dulaney <jdulaney@fedoraproject.org>
Wed, 16 Dec 2015 00:02:12 +0000 (19:02 -0500)
Signed-off-by: John Dulaney <jdulaney@fedoraproject.org>
class/50-host-classes
scripts/YOURLS/10_download_yourls.sh [new file with mode: 0644]

index 572f74e..7720771 100755 (executable)
@@ -69,7 +69,7 @@ case $HOSTNAME in
        echo "FAIBASE WWW CIVICRM SYSADMIN VM MYSQLD"
        ;;
     gnusocial*)
-       echo "FAIBASE WWW SYSADMIN VM MYSQLD GNUSOCIAL"
+       echo "FAIBASE WWW SYSADMIN VM MYSQLD GNUSOCIAL YOURLS"
        ;;
     nagios*)
        echo "FAIBASE SYSADMIN VM MYSQLD NAGIOS WWW"
diff --git a/scripts/YOURLS/10_download_yourls.sh b/scripts/YOURLS/10_download_yourls.sh
new file mode 100644 (file)
index 0000000..eae43f8
--- /dev/null
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+YOURLS_VERS='1.7.1'
+
+# Download yourls and install; we're going to be doing this under the gnusocial user.
+if ! $ROOTCMD getent passwd gnusocial ; then
+    $ROOTCMD adduser --system --ingroup www-data --disabled-password --gecos "gnusocial user" gnusocial
+fi
+
+if ! $ROOTCMD test -e /home/gnusocial/.ssh/id_rsa; then
+    $ROOTCMD echo | $ROOTCMD sudo -u gnusocial ssh-keygen -N ''
+fi
+
+if ! $ROOTCMD echo | cd /home/gnusocial/ 
+    mkdir /var/www/yourls
+    curl https://codeload.github.com/YOURLS/YOURLS/tar.gz/$YOURLS_VERS -o /home/gnusocial/yourls.tar.gz; then
+    tar xf /home/gnusocial/yourls.tar.gz -C /home/gnusocial/
+    mv /home/gnusocial/YOURLS-$YOURLS_VERS/* /var/www/yourls/
+fi