From 49d72d6fcf042ad375584eb4b62e7555fc43f132 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 17 Nov 2017 23:36:31 +0100 Subject: [PATCH] v159 + DietPi-Software | ownCloud: Installation fixed for all distros --- dietpi/dietpi-software | 49 ++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7dd02d7220..4a73821ce5 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -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 @@ -4037,13 +4037,25 @@ _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 @@ -4051,17 +4063,26 @@ _EOF_ 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 @@ -9034,16 +9055,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 @@ -13077,10 +13094,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