config path

This commit is contained in:
Bob Mottram 2016-03-12 13:47:28 +00:00
parent dbd80e52a0
commit 75d75a6083
1 changed files with 39 additions and 36 deletions

View File

@ -6524,47 +6524,49 @@ function upgrade_owncloud_finish {
mkdir $OWNCLOUD_PATH/data
fi
cp -r $OWNCLOUD_UPGRADE_PATH/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
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 config.php | grep "instanceid" | awk -F "'" '{print $4}')
OWNCLOUD_PASSWORD_SALT=$(cat config.php | grep "passwordsalt" | awk -F "'" '{print $4}')
OWNCLOUD_DATA_DIR=$(cat config.php | grep "datadirectory" | awk -F "'" '{print $4}')
OWNCLOUD_DBTYPE=$(cat config.php | grep "dbtype" | awk -F "'" '{print $4}')
OWNCLOUD_DBNAME=$(cat config.php | grep "dbname" | awk -F "'" '{print $4}')
OWNCLOUD_DBHOST=$(cat config.php | grep "dbhost" | awk -F "'" '{print $4}')
OWNCLOUD_DBUSER=$(cat config.php | grep "dbuser" | awk -F "'" '{print $4}')
OWNCLOUD_DBPASS=$(cat config.php | grep "dbpassword" | awk -F "'" '{print $4}')
OWNCLOUD_SECRET=$(cat 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 {
@ -6884,6 +6886,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
fi
if [ -f $OWNCLOUD_PATH/config/config.php ]; then