diff --git a/nextcloud/10.0/run.sh b/nextcloud/10.0/run.sh index 9885eb7..9047e92 100644 --- a/nextcloud/10.0/run.sh +++ b/nextcloud/10.0/run.sh @@ -1,19 +1,24 @@ #!/bin/sh addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud -if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then - cp /nextcloud/config/config.php /config/config.php -elif [ -f /config/config.php ]; then - if [ -f /nextcloud/config/config.php ]; then - sed -i "s/.*version.*/`grep "version" \/nextcloud\/config\/config.php`/" /config/config.php - CONFIG=`md5sum /config/config.php | awk '{ print $1 }'` - CONFIGINS=`md5sum /nextcloud/config/config.php | awk '{ print $1 }'` - if [ $CONFIG != $CONFIGINS ]; then - mv /nextcloud/config/config.php /config/config.php.bkp +function copy_config { + if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then + cp /nextcloud/config/config.php /config/config.php + elif [ -f /config/config.php ]; then + if [ -f /nextcloud/config/config.php ]; then + sed -i "s/.*version.*/`grep "version" \/nextcloud\/config\/config.php`/" /config/config.php + CONFIG=`md5sum /config/config.php | awk '{ print $1 }'` + CONFIGINS=`md5sum /nextcloud/config/config.php | awk '{ print $1 }'` + if [ $CONFIG != $CONFIGINS ]; then + mv /nextcloud/config/config.php /config/config.php.bkp + fi fi + cp /config/config.php /nextcloud/config/config.php fi - cp /config/config.php /nextcloud/config/config.php -fi +} + +copy_config +trap copy_config EXIT touch /var/run/php-fpm.sock mkdir /tmp/fastcgi /tmp/client_body diff --git a/nextcloud/9.0/run.sh b/nextcloud/9.0/run.sh index 9885eb7..9047e92 100644 --- a/nextcloud/9.0/run.sh +++ b/nextcloud/9.0/run.sh @@ -1,19 +1,24 @@ #!/bin/sh addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud -if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then - cp /nextcloud/config/config.php /config/config.php -elif [ -f /config/config.php ]; then - if [ -f /nextcloud/config/config.php ]; then - sed -i "s/.*version.*/`grep "version" \/nextcloud\/config\/config.php`/" /config/config.php - CONFIG=`md5sum /config/config.php | awk '{ print $1 }'` - CONFIGINS=`md5sum /nextcloud/config/config.php | awk '{ print $1 }'` - if [ $CONFIG != $CONFIGINS ]; then - mv /nextcloud/config/config.php /config/config.php.bkp +function copy_config { + if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then + cp /nextcloud/config/config.php /config/config.php + elif [ -f /config/config.php ]; then + if [ -f /nextcloud/config/config.php ]; then + sed -i "s/.*version.*/`grep "version" \/nextcloud\/config\/config.php`/" /config/config.php + CONFIG=`md5sum /config/config.php | awk '{ print $1 }'` + CONFIGINS=`md5sum /nextcloud/config/config.php | awk '{ print $1 }'` + if [ $CONFIG != $CONFIGINS ]; then + mv /nextcloud/config/config.php /config/config.php.bkp + fi fi + cp /config/config.php /nextcloud/config/config.php fi - cp /config/config.php /nextcloud/config/config.php -fi +} + +copy_config +trap copy_config EXIT touch /var/run/php-fpm.sock mkdir /tmp/fastcgi /tmp/client_body diff --git a/nextcloud/daily/run.sh b/nextcloud/daily/run.sh index 9885eb7..9047e92 100644 --- a/nextcloud/daily/run.sh +++ b/nextcloud/daily/run.sh @@ -1,19 +1,24 @@ #!/bin/sh addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud -if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then - cp /nextcloud/config/config.php /config/config.php -elif [ -f /config/config.php ]; then - if [ -f /nextcloud/config/config.php ]; then - sed -i "s/.*version.*/`grep "version" \/nextcloud\/config\/config.php`/" /config/config.php - CONFIG=`md5sum /config/config.php | awk '{ print $1 }'` - CONFIGINS=`md5sum /nextcloud/config/config.php | awk '{ print $1 }'` - if [ $CONFIG != $CONFIGINS ]; then - mv /nextcloud/config/config.php /config/config.php.bkp +function copy_config { + if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then + cp /nextcloud/config/config.php /config/config.php + elif [ -f /config/config.php ]; then + if [ -f /nextcloud/config/config.php ]; then + sed -i "s/.*version.*/`grep "version" \/nextcloud\/config\/config.php`/" /config/config.php + CONFIG=`md5sum /config/config.php | awk '{ print $1 }'` + CONFIGINS=`md5sum /nextcloud/config/config.php | awk '{ print $1 }'` + if [ $CONFIG != $CONFIGINS ]; then + mv /nextcloud/config/config.php /config/config.php.bkp + fi fi + cp /config/config.php /nextcloud/config/config.php fi - cp /config/config.php /nextcloud/config/config.php -fi +} + +copy_config +trap copy_config EXIT touch /var/run/php-fpm.sock mkdir /tmp/fastcgi /tmp/client_body