Skip to content

Instantly share code, notes, and snippets.

@jorinvo
Last active July 2, 2016 11:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorinvo/036db64abf9f3c2153f7 to your computer and use it in GitHub Desktop.
Save jorinvo/036db64abf9f3c2153f7 to your computer and use it in GitHub Desktop.
Update ownCloud on Uberspace
#!/bin/sh
set -e # Exit script on errors
#
# Update ownCloud on Uberspace
#
# WARNING: Please don't use this script as is!
#
# Adjust it to your personal setup.
#
# The script assumes that the data folder
# of your owncloud is not in the application folder.
# You need to install all plugins manually again after updating.
#
# Make sure the script is executable with: chmod +x update-owncloud.sh
OWNCLOUD_VERSION="$1"
TAR_FILE="owncloud-${OWNCLOUD_VERSION}.tar.bz2"
DOWNLOAD_URL="https://download.owncloud.org/community/$TAR_FILE"
URL="your-domain.com" # THIS IS SPECIFIC TO EVERY SETUP
CLOUD="/var/www/virtual/$USER/$URL"
WWW_CLOUD="/var/www/virtual/$USER/www.$URL"
echo checking version
test -z "$OWNCLOUD_VERSION" && echo "No version specified. Try: ./update-owncloud.sh 8.2.2" && exit 1
cd $HOME/tmp
echo downloading
wget $DOWNLOAD_URL
echo extracting
tar -xjvf $TAR_FILE
rm $TAR_FILE
echo copying config
cp $CLOUD/config/config.php owncloud/config/config.php
echo copying new owncloud files
rm -rf $CLOUD/*
cp -r owncloud/* owncloud/.htaccess $CLOUD
echo creating link for www.
rm $WWW_CLOUD
ln -s $CLOUD $WWW_CLOUD
echo cleaning up tmp folder
rm -rf owncloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment