owncloud: update config.php backup strategy

This commit is contained in:
Wonderfall 2016-05-01 19:41:40 +02:00
parent 873ce86f41
commit b1b20c0b2d

View File

@ -7,9 +7,13 @@ elif [ -f /config/config.php ]; then
if [ -f /owncloud/config/config.php ]; then
sed -i "s/.*version.*/`grep "version" \/owncloud\/config\/config.php`/" /config/config.php
fi
CONFIG=`md5sum /config/config.php | awk '{ print $1 }'`
CONFIGINS=`md5sum /owncloud/config/config.php | awk '{ print $1 }'`
if [ $CONFIG != $CONFIGINS ]; then
mv /owncloud/config/config.php /config/config.php.bkp
cp /config/config.php /owncloud/config/config.php
fi
fi
touch /var/run/php-fpm.sock
chown -R owncloud:owncloud /owncloud /data /config /apps2 /var/run/php-fpm.sock /var/lib/nginx /tmp