aboutsummaryrefslogtreecommitdiff
path: root/roundcube-dl
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-10-17 14:42:04 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-10-17 14:42:04 -0300
commit632567f6485bca46119fd2d4cacfbbc81ce3d68b (patch)
tree7db71f5fbcaea55b46b2867c026e53f936953415 /roundcube-dl
parent7138ad699d3439886d805738402c5dd3cdd1b289 (diff)
downloaddownloaders-632567f6485bca46119fd2d4cacfbbc81ce3d68b.tar.gz
downloaders-632567f6485bca46119fd2d4cacfbbc81ce3d68b.tar.bz2
Adding more downloaders
Diffstat (limited to 'roundcube-dl')
-rwxr-xr-xroundcube-dl68
1 files changed, 68 insertions, 0 deletions
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."