From ee244386ed629b6c529097724f7b66d39b2710e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20K=C3=A5berg?= Date: Sun, 31 Aug 2014 20:34:57 +0200 Subject: [PATCH] update ownCloud if necessary this will always download the latest ownCloud and upgrade if ownCloud install dir exist, this apphroach allows us to keep existing user plugins. currently not checking if currently installed version is equal to the one we're downloading as I couldn't find a proper solution for that --- setup/owncloud.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/setup/owncloud.sh b/setup/owncloud.sh index 1c7aa451..ad71c137 100755 --- a/setup/owncloud.sh +++ b/setup/owncloud.sh @@ -12,16 +12,22 @@ apt_install \ apt-get purge -qq -y owncloud* -# Install ownCloud from source if it is not already present -# TODO: Check version? +# Install ownCloud from source +echo installing ownCloud... +rm -f /tmp/owncloud.zip +wget -qO /tmp/owncloud.zip https://download.owncloud.org/community/owncloud-latest.zip + if [ ! -d /usr/local/lib/owncloud ]; then - echo installing ownCloud... - rm -f /tmp/owncloud.zip - wget -qO /tmp/owncloud.zip https://download.owncloud.org/community/owncloud-7.0.1.zip + # fresh install unzip -q /tmp/owncloud.zip -d /usr/local/lib - rm -f /tmp/owncloud.zip +else + # upgrade existing install + unzip -u -o -q /tmp/owncloud.zip -d /usr/local/lib + hide_output php /usr/local/lib/owncloud/occ upgrade fi +rm -f /tmp/owncloud.zip + # Setup ownCloud if the ownCloud database does not yet exist. Running setup when # the database does exist wipes the database and user data. if [ ! -f $STORAGE_ROOT/owncloud/owncloud.db ]; then