diff --git a/src/freedombone b/src/freedombone index 679427d8..3b55ba5f 100755 --- a/src/freedombone +++ b/src/freedombone @@ -6397,7 +6397,7 @@ function install_owncloud_repo_music_app { return fi - if ! grep -Fxq "install_owncloud_from_repo" $COMPLETION_FILE; then + if ! grep -Fxq "install_owncloud_official_deb" $COMPLETION_FILE; then echo $'Tried to install the Owncloud music app, but Owncloud installation was not found' exit 9823 fi @@ -6478,6 +6478,8 @@ function upgrade_owncloud_start { return fi + echo $'Starting upgrade of Owncloud' + # remove any owncloud entries from completion sed -i '/install_owncloud.*/d' $COMPLETION_FILE sed -i '/owncloud.*/d' $COMPLETION_FILE @@ -6520,53 +6522,55 @@ function upgrade_owncloud_finish { return fi + echo $'Finishing upgrade of Owncloud' + if [ ! -d $OWNCLOUD_PATH/data ]; then mkdir $OWNCLOUD_PATH/data fi cp -r $OWNCLOUD_UPGRADE_PATH/data/* $OWNCLOUD_PATH/data/ - chown -R www-data:www-data $OWNCLOUD_PATH/data + chown -R www-data:www-data $OWNCLOUD_PATH/data - if [ ! -f $OWNCLOUD_PATH/config/config.php ]; then - if [ ! -f $OWNCLOUD_PATH/config/config.sample.php ]; then - echo $'No owncloud configuration sample file found' - exit 54289 - fi - cp $OWNCLOUD_PATH/config/config.sample.php $OWNCLOUD_PATH/config/config.php - chown root:root $OWNCLOUD_PATH/config/config.php - fi + if [ ! -f $OWNCLOUD_PATH/config/config.php ]; then + if [ ! -f $OWNCLOUD_PATH/config/config.sample.php ]; then + echo $'No owncloud configuration sample file found' + exit 54289 + fi + cp $OWNCLOUD_PATH/config/config.sample.php $OWNCLOUD_PATH/config/config.php + chown root:root $OWNCLOUD_PATH/config/config.php + fi - if [ -f $OWNCLOUD_UPGRADE_PATH/config/config.php ]; then - OWNCLOUD_INSTANCE_ID=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "instanceid" | awk -F "'" '{print $4}') - OWNCLOUD_PASSWORD_SALT=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "passwordsalt" | awk -F "'" '{print $4}') - OWNCLOUD_DATA_DIR=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "datadirectory" | awk -F "'" '{print $4}') - OWNCLOUD_DBTYPE=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbtype" | awk -F "'" '{print $4}') - OWNCLOUD_DBNAME=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbname" | awk -F "'" '{print $4}') - OWNCLOUD_DBHOST=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbhost" | awk -F "'" '{print $4}') - OWNCLOUD_DBUSER=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbuser" | awk -F "'" '{print $4}') - OWNCLOUD_DBPASS=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbpassword" | awk -F "'" '{print $4}') - OWNCLOUD_SECRET=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "secret" | awk -F "'" '{print $4}') + if [ -f $OWNCLOUD_UPGRADE_PATH/config/config.php ]; then + OWNCLOUD_INSTANCE_ID=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "instanceid" | awk -F "'" '{print $4}') + OWNCLOUD_PASSWORD_SALT=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "passwordsalt" | awk -F "'" '{print $4}') + OWNCLOUD_DATA_DIR=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "datadirectory" | awk -F "'" '{print $4}') + OWNCLOUD_DBTYPE=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbtype" | awk -F "'" '{print $4}') + OWNCLOUD_DBNAME=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbname" | awk -F "'" '{print $4}') + OWNCLOUD_DBHOST=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbhost" | awk -F "'" '{print $4}') + OWNCLOUD_DBUSER=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbuser" | awk -F "'" '{print $4}') + OWNCLOUD_DBPASS=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "dbpassword" | awk -F "'" '{print $4}') + OWNCLOUD_SECRET=$(cat $OWNCLOUD_UPGRADE_PATH/config/config.php | grep "secret" | awk -F "'" '{print $4}') - sed -i "s|'instanceid'.*|'instanceid' => '$OWNCLOUD_INSTANCE_ID',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'passwordsalt'.*|'passwordsalt' => '$OWNCLOUD_PASSWORD_SALT',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'datadirectory'.*|'datadirectory' => '$OWNCLOUD_DATA_DIR',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'dbtype'.*|'dbtype' => '$OWNCLOUD_DBTYPE',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'dbname'.*|'dbname' => '$OWNCLOUD_DBNAME',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'dbhost'.*|'dbhost' => '$OWNCLOUD_DBHOST',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'dbuser'.*|'dbuser' => '$OWNCLOUD_DBUSER',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'dbpassword'.*|'dbpassword' => '$OWNCLOUD_DBPASS',|g" $OWNCLOUD_PATH/config/config.php - sed -i "s|'secret'.*|'secret' => '$OWNCLOUD_SECRET',|g" $OWNCLOUD_PATH/config/config.php - fi + sed -i "s|'instanceid'.*|'instanceid' => '$OWNCLOUD_INSTANCE_ID',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'passwordsalt'.*|'passwordsalt' => '$OWNCLOUD_PASSWORD_SALT',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'datadirectory'.*|'datadirectory' => '$OWNCLOUD_DATA_DIR',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'dbtype'.*|'dbtype' => '$OWNCLOUD_DBTYPE',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'dbname'.*|'dbname' => '$OWNCLOUD_DBNAME',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'dbhost'.*|'dbhost' => '$OWNCLOUD_DBHOST',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'dbuser'.*|'dbuser' => '$OWNCLOUD_DBUSER',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'dbpassword'.*|'dbpassword' => '$OWNCLOUD_DBPASS',|g" $OWNCLOUD_PATH/config/config.php + sed -i "s|'secret'.*|'secret' => '$OWNCLOUD_SECRET',|g" $OWNCLOUD_PATH/config/config.php + fi - # re-index the files - for d in /home/*/ ; do - USRNAME=$(echo "$d" | awk -F '/' '{print $3}') - if [[ $USRNAME != "git" && $USRNAME != "mirrors" ]]; then - $OWNCLOUD_PATH/occ files:scan $USRNAME - fi - done + # re-index the files + for d in /home/*/ ; do + USRNAME=$(echo "$d" | awk -F '/' '{print $3}') + if [[ $USRNAME != "git" && $USRNAME != "mirrors" ]]; then + $OWNCLOUD_PATH/occ files:scan $USRNAME + fi + done - # remove the temporary upgrade - rm -rf $OWNCLOUD_UPGRADE_PATH + # remove the temporary upgrade + rm -rf $OWNCLOUD_UPGRADE_PATH } function install_owncloud_official_deb { @@ -6886,7 +6890,7 @@ function install_owncloud_official_deb { exit 54289 fi cp $OWNCLOUD_PATH/config/config.sample.php $OWNCLOUD_PATH/config/config.php - chown root:root $OWNCLOUD_PATH/config/config.php + chown root:root $OWNCLOUD_PATH/config/config.php fi if [ -f $OWNCLOUD_PATH/config/config.php ]; then