Skip to content

Instantly share code, notes, and snippets.

@lennysh
Last active May 2, 2017 14:49
Show Gist options
  • Save lennysh/dc7204bd89d74a2d97d2d04f783eacfe to your computer and use it in GitHub Desktop.
Save lennysh/dc7204bd89d74a2d97d2d04f783eacfe to your computer and use it in GitHub Desktop.
#!/bin/bash
# Script to install ownCloud in Ubuntu
. /etc/lsb-release
#DISTRIB_ID=Ubuntu
#DISTRIB_RELEASE=12.04
#DISTRIB_CODENAME=precise
#DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
DESC=$DISTRIB_DESCRIPTION
#echo $OS
#echo $VER
#echo $DESC
if [ "$OS" != "Ubuntu" ]; then
echo "This version of $DESC is not supported."
exit 1
fi
case $VER in
16.10)
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_16.10/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_16.10/ /' > /etc/apt/sources.list.d/owncloud.list"
;;
16.04)
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud.list"
;;
15.10)
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_15.10/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_15.10/ /' > /etc/apt/sources.list.d/owncloud.list"
;;
14.10)
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_14.10/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_14.10/ /' > /etc/apt/sources.list.d/owncloud.list"
;;
14.04)
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/ /' > /etc/apt/sources.list.d/owncloud.list"
;;
12.04)
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_12.04/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_12.04/ /' > /etc/apt/sources.list.d/owncloud.list"
;;
*)
echo "This version of $DESC is not supported."
exit 1
;;
esac
clear
apt-get update
apt-get install memcached php-memcached php-apcu redis-server php-redis php-ldap smbclient cifs-utils owncloud -y
clear
service apache2 restart
echo
echo "Add the following lines to /var/www/owncloud/config/config.php above the closing bracket:"
echo " 'memcache.local' => '\\OC\\Memcache\\APCu',"
echo " 'memcache.locking' => '\\OC\\Memcache\\Redis',"
echo " 'redis' =>"
echo " array ("
echo " 'host' => 'localhost',"
echo " 'port' => 6379,"
echo " ),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment