]> gitweb.fluxo.info Git - downloaders.git/commitdiff
Adding more downloaders
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Oct 2014 17:42:04 +0000 (14:42 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Oct 2014 17:42:04 +0000 (14:42 -0300)
TODO.md
owncloud-dl [new file with mode: 0755]
piwigo-dl [new file with mode: 0755]
piwik-dl [new file with mode: 0755]
roundcube-dl [new file with mode: 0755]
semanticscuttle-dl [new file with mode: 0755]

diff --git a/TODO.md b/TODO.md
index d453d90a93d662d8dddb93c40d767e86a8227b67..8ab655d36fa3eef112b989755ec94ea48510f2d9 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,9 +1,4 @@
 TODO
 ====
 
-* Add downloader scripts for:
-  * Piwik.
-  * Piwigo.
-  * Owncloud.
-  * Roundcube.
-  * SemanticScuttle.
+* Nothing here? :P
diff --git a/owncloud-dl b/owncloud-dl
new file mode 100755 (executable)
index 0000000..3ac5a60
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Owncloud software upgrader.
+# See http://doc.owncloud.org/server/7.0/admin_manual/maintenance/upgrade.html
+#
+
+# Config parameters
+BASENAME="`basename $0`"
+OLD_VERSION="$1"
+VERSION="$2"
+
+# Syntax check
+if [ -z "$2" ]; then
+  echo "usage: $BASENAME <old-version> <new-version>"
+  exit 1
+fi
+
+# Check installed versions
+if [ ! -d "owncloud-$OLD_VERSION" ]; then
+  echo "error: owncloud-$OLD_VERSION is not installed, aborting."
+  exit 1
+elif [ -d "owncloud-$VERSION" ]; then
+  echo "error: owncloud-$VERSION already installed, aborting."
+  exit 1
+fi
+
+# Download package
+wget https://download.owncloud.org/community/owncloud-$VERSION.tar.bz2
+
+# Decompress
+(
+  mkdir tmp
+  cd tmp
+  tar xvf ../owncloud-$VERSION.tar.bz2
+  mv owncloud ../owncloud-$VERSION
+  cd ..
+  rmdir tmp
+)
+
+# Remove package
+rm owncloud-$VERSION.tar.bz2
+
+# Sync configuration
+chown -R root. owncloud-$VERSION
+rsync -av owncloud-$OLD_VERSION/config/ owncloud-$VERSION/config/
+
+# Symlink to contrib content
+(
+  cd owncloud-$VERSION
+  ln -s ../contrib
+  rm -rf themes
+  ln -s contrib/themes
+)
+
+# Pivot
+rm owncloud && ln -s owncloud-$VERSION owncloud
+
+# Audit
+echo "Audit:" && \
+du -hs owncloud-$OLD_VERSION && \
+du -hs owncloud-$VERSION
+
+# Finish
+echo "Please fix config.php manually."
diff --git a/piwigo-dl b/piwigo-dl
new file mode 100755 (executable)
index 0000000..3955057
--- /dev/null
+++ b/piwigo-dl
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# Piwgo simple upgrader.
+#
+
+wget http://piwigo.org/download/dlcounter.php?code=latest -O latest.zip && \
+mv piwigo/ piwigo.old && \
+unzip latest.zip && \
+rm latest.zip && \
+( cd piwigo && rm -rf galleries && ln -s ../galleries/piwigo galleries ) && \
+cp -a piwigo.old/local/config/database.inc.php piwigo/local/config/database.inc.php && \
+echo "Audit:" && \
+du -hs piwigo && \
+du -hs piwigo.old
diff --git a/piwik-dl b/piwik-dl
new file mode 100755 (executable)
index 0000000..e266c0b
--- /dev/null
+++ b/piwik-dl
@@ -0,0 +1,15 @@
+#!/bin/bash
+#
+# Piwik simple upgrader.
+#
+
+wget http://piwik.org/latest.zip && \
+mv piwik/ piwik.old && \
+unzip latest.zip && \
+rm *html && \
+rm latest.zip && \
+cp -a piwik.old/config/config.ini.php piwik/config/ && \
+chown -R stats.stats piwik/{config,tmp} && \
+echo "Audit:" && \
+du -hs piwik && \
+du -hs piwik.old
diff --git a/roundcube-dl b/roundcube-dl
new file mode 100755 (executable)
index 0000000..660006a
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# Roundcube software upgrader.
+#
+
+# Config parameters
+BASENAME="`basename $0`"
+OLD_VERSION="$1"
+VERSION="$2"
+MD5="$3"
+
+# Syntax check
+if [ -z "$3" ]; then
+  echo "usage: $BASENAME <old-version> <new-version> <md5>"
+  exit 1
+fi
+
+# Check installed versions
+if [ ! -d "roundcubemail-$OLD_VERSION" ]; then
+  echo "error: roundcubemail-$OLD_VERSION is not installed, aborting."
+  exit 1
+elif [ -d "roundcubemail-$VERSION" ]; then
+  echo "error: roundcubemail-$VERSION already installed, aborting."
+  exit 1
+fi
+
+# Download package
+wget http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/$VERSION/roundcubemail-$VERSION.tar.gz
+
+# Check integrity
+echo "$MD5  roundcubemail-$VERSION.tar.gz" | md5sum -c
+if [ "$?" != "0" ]; then
+  echo "error: roundcubemail-$VERSION.tar.gz doesn't match MD5 $MD5, aborting"
+  exit
+fi
+
+# Decompress
+tar xvf roundcubemail-$VERSION.tar.gz
+
+# Remove package
+rm roundcubemail-$VERSION.tar.gz
+
+# Fix permissions
+chown -R root. roundcubemail-$VERSION
+
+# Sync configuration
+for section in db config custom logs temp; do
+  rsync -av roundcubemail-$OLD_VERSION/$section/ roundcubemail-$VERSION/$section/
+done
+
+# Symlink skins
+(
+  cd roundcubemail-$VERSION/skins
+  for skin in `ls ../custom/skins`; do
+    ln -s ../custom/skins/$skin
+  done
+)
+
+# Pivot
+rm roundcube && ln -s roundcubemail-$VERSION roundcube
+
+# Audit
+echo "Audit:" && \
+du -hs roundcubemail-$OLD_VERSION && \
+du -hs roundcubemail-$VERSION
+
+# Manual steps
+echo "Please update plugin symlinks manually."
diff --git a/semanticscuttle-dl b/semanticscuttle-dl
new file mode 100755 (executable)
index 0000000..c4f1e50
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# SemanticScuttle simple upgrader.
+#
+
+BASENAME="`basename $0`"
+PREVIOUS="$1"
+CURRENT="$2"
+
+if [ -z "$CURRENT" ]; then
+  echo "usage: $BASENAME <previous> <current>"
+  exit 1
+fi
+
+wget http://downloads.sourceforge.net/project/semanticscuttle/SemanticScuttle/v0.98/SemanticScuttle-$CURRENT.zip && \
+unzip SemanticScuttle-$CURRENT.zip && \
+rm SemanticScuttle-$CURRENT.zip && \
+cp -a SemanticScuttle-$PREVIOUS/data/config.php SemanticScuttle-$CURRENT/data/ && \
+rm site && \
+ln -s SemanticScuttle-$CURRENT/www site && \
+echo "Audit:" && \
+du -hs SemanticScuttle-$PREVIOUS && \
+du -hs SemanticScuttle-$CURRENT
+
+if [ -d "patches" ]; then
+  echo "Check and apply the following patches manually:"
+  find patches
+fi