From 8b2fed1a2a21ae9edfe423eaf55145341ca3cf97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20K=C3=A5berg?= Date: Mon, 1 Sep 2014 10:02:46 +0200 Subject: [PATCH] fixes comments by @JoshData --- setup/owncloud.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/setup/owncloud.sh b/setup/owncloud.sh index ad71c137..eecaf438 100755 --- a/setup/owncloud.sh +++ b/setup/owncloud.sh @@ -13,21 +13,20 @@ apt_install \ apt-get purge -qq -y owncloud* # 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 +# Check if ownCloud dir exist, and check if version matches 7.0.1 (if it does, upgrade) +owncloud_ver=7.0.2 -if [ ! -d /usr/local/lib/owncloud ]; then - # fresh install - unzip -q /tmp/owncloud.zip -d /usr/local/lib -else - # upgrade existing install - unzip -u -o -q /tmp/owncloud.zip -d /usr/local/lib - hide_output php /usr/local/lib/owncloud/occ upgrade +if [ ! -d /usr/local/lib/owncloud/ ] \ + || ! grep -q $owncloud_ver /usr/local/lib/owncloud/version.php; then + + echo installing ownCloud... + rm -f /tmp/owncloud.zip + wget -qO /tmp/owncloud.zip https://download.owncloud.org/community/owncloud-$owncloud_ver.zip + unzip -u -o -q /tmp/owncloud.zip -d /usr/local/lib #either extracts new or replaces current files + hide_output php /usr/local/lib/owncloud/occ upgrade #if OC is up-to-date it wont matter + rm -f /tmp/owncloud.zip 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