aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md7
-rwxr-xr-xowncloud-dl64
-rwxr-xr-xpiwigo-dl14
-rwxr-xr-xpiwik-dl15
-rwxr-xr-xroundcube-dl68
-rwxr-xr-xsemanticscuttle-dl28
6 files changed, 190 insertions, 6 deletions
diff --git a/TODO.md b/TODO.md
index d453d90..8ab655d 100644
--- 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
index 0000000..3ac5a60
--- /dev/null
+++ b/owncloud-dl
@@ -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
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
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
index 0000000..660006a
--- /dev/null
+++ b/roundcube-dl
@@ -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
index 0000000..c4f1e50
--- /dev/null
+++ b/semanticscuttle-dl
@@ -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