Merge branch 'master' into sudoman-mods
[fai-configs.git] / scripts / GNUSOCIAL / 10_download_gnusocial.sh
diff --git a/scripts/GNUSOCIAL/10_download_gnusocial.sh b/scripts/GNUSOCIAL/10_download_gnusocial.sh
new file mode 100644 (file)
index 0000000..48a7bc7
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+# Download gnusocial directly from their download source, as it is the recommended route and there is no repo
+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/statusnet/
+    git clone https://git.gnu.io/gnu/gnu-social.git /home/gnusocial/gnu-social; then
+    rm -rf /home/gnusocial/gnu-social/.git
+    mv /home/gnusocial/gnu-social/* /var/www/statusnet/
+fi