From 632567f6485bca46119fd2d4cacfbbc81ce3d68b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 Oct 2014 14:42:04 -0300 Subject: Adding more downloaders --- owncloud-dl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 owncloud-dl (limited to 'owncloud-dl') 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 " + 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." -- cgit v1.2.3