Skip to content

Commit

Permalink
Merge pull request #1243 from MichaIng/patch-2
Browse files Browse the repository at this point in the history
DietPi-Software | ownCloud: Installation fixed for all distros
  • Loading branch information
Fourdee authored Nov 20, 2017
2 parents 5fe8404 + 49d72d6 commit 397f103
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ _EOF_
#--------------------------------------------------------------------------------
index_current=47

aSOFTWARE_WHIP_NAME[$index_current]='OwnCloud'
aSOFTWARE_WHIP_NAME[$index_current]='ownCloud'
aSOFTWARE_WHIP_DESC[$index_current]='your very own cloud (eg: dropbox)'
aSOFTWARE_CATEGORY_INDEX[$index_current]=4
aSOFTWARE_TYPE[$index_current]=0
Expand Down Expand Up @@ -4099,31 +4099,52 @@ _EOF_

fi

#OwnCloud
#ownCloud
INSTALLING_INDEX=47
if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then

Banner_Installing

INSTALL_URL_ADDRESS='https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key'
if (( $DISTRO == 3 )); then

INSTALL_URL_ADDRESS='https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key'

elif (( $DISTRO == 4 )); then

INSTALL_URL_ADDRESS='https://download.owncloud.org/download/repositories/stable/Debian_9.0/Release.key'

else

INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip'

fi

/DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS"
#Install
if (( $? == 0 )); then

if [ ! -f /etc/apt/sources.list.d/owncloud.list ]; then

wget "$INSTALL_URL_ADDRESS" -O owncloud.key
apt-key add - < owncloud.key
rm owncloud.key
wget "$INSTALL_URL_ADDRESS" -O owncloud.key_or_zip
apt-key add - < owncloud.key_or_zip &> /dev/null
unzip -o owncloud.key_or_zip -d /var/www &> /dev/null
rm owncloud.key_or_zip

echo -e "deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /" > /etc/apt/sources.list.d/owncloud.list
if (( $DISTRO == 3 )); then

apt-get update
echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_8.0/ /" > /etc/apt/sources.list.d/owncloud.list
apt-get update

elif (( $DISTRO == 4 )); then

echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_9.0/ /" > /etc/apt/sources.list.d/owncloud.list
apt-get update

fi

fi

AGI owncloud
AGI owncloud-files &> /dev/null

else

Expand Down Expand Up @@ -9068,16 +9089,12 @@ _EOF_
INSTALLING_INDEX=47
if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then

#Symlink /usr/share/owncloud to /var/www/owncloud: https://github.com/Fourdee/DietPi/issues/1225#issuecomment-343263082
rm -R /var/www/owncloud &> /dev/null
ln -fs /usr/share/owncloud /var/www/owncloud

#Setup Data directory
local target_data_dir="$FP_DIETPI_USERDATA_DIRECTORY/owncloud_data"
mkdir -p "$target_data_dir"

#Create symlink from default owncloud/data to FP_DIETPI_USERDATA_DIRECTORY
local target_data_symlink="/usr/share/owncloud/data"
local target_data_symlink="/var/www/owncloud/data"
mkdir -p "$target_data_symlink" &> /dev/null

# - Copy existing data to our data location
Expand Down Expand Up @@ -13129,10 +13146,10 @@ _EOF_

elif (( $1 == 47 )); then

AGP owncloud
AGP owncloud-files owncloud owncloud-deps
systemctl start mysql
mysqladmin -u root -p"$GLOBAL_PW" drop owncloud -f
rm /etc/apt/sources.list.d/owncloud.list
rm /etc/apt/sources.list.d/owncloud.list $> /dev/null
apt-get update
rm -R /var/www/owncloud

Expand Down

0 comments on commit 397f103

Please sign in to comment.