diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-10-17 14:42:04 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-10-17 14:42:04 -0300 |
commit | 632567f6485bca46119fd2d4cacfbbc81ce3d68b (patch) | |
tree | 7db71f5fbcaea55b46b2867c026e53f936953415 /owncloud-dl | |
parent | 7138ad699d3439886d805738402c5dd3cdd1b289 (diff) | |
download | downloaders-632567f6485bca46119fd2d4cacfbbc81ce3d68b.tar.gz downloaders-632567f6485bca46119fd2d4cacfbbc81ce3d68b.tar.bz2 |
Adding more downloaders
Diffstat (limited to 'owncloud-dl')
-rwxr-xr-x | owncloud-dl | 64 |
1 files changed, 64 insertions, 0 deletions
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." |