mod: symblic link instead coping

This commit is contained in:
kvaps 2016-08-16 17:34:20 +03:00
parent 850e3e41e2
commit 391b54ca39
3 changed files with 12 additions and 54 deletions

View File

@ -1,24 +1,10 @@
#!/bin/sh #!/bin/sh
addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud
function copy_config { if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then
if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then mv /nextcloud/config/config.php /config/config.php
cp /nextcloud/config/config.php /config/config.php fi
elif [ -f /config/config.php ]; then ln -s /config/config.php /nextcloud/config/config.php
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
}
copy_config
trap copy_config EXIT
touch /var/run/php-fpm.sock touch /var/run/php-fpm.sock
mkdir /tmp/fastcgi /tmp/client_body mkdir /tmp/fastcgi /tmp/client_body

View File

@ -1,24 +1,10 @@
#!/bin/sh #!/bin/sh
addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud
function copy_config { if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then
if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then mv /nextcloud/config/config.php /config/config.php
cp /nextcloud/config/config.php /config/config.php fi
elif [ -f /config/config.php ]; then ln -s /config/config.php /nextcloud/config/config.php
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
}
copy_config
trap copy_config EXIT
touch /var/run/php-fpm.sock touch /var/run/php-fpm.sock
mkdir /tmp/fastcgi /tmp/client_body mkdir /tmp/fastcgi /tmp/client_body

View File

@ -1,24 +1,10 @@
#!/bin/sh #!/bin/sh
addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud
function copy_config { if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then
if [ -f /nextcloud/config/config.php ] && [ ! -f /config/config.php ]; then mv /nextcloud/config/config.php /config/config.php
cp /nextcloud/config/config.php /config/config.php fi
elif [ -f /config/config.php ]; then ln -s /config/config.php /nextcloud/config/config.php
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
}
copy_config
trap copy_config EXIT
touch /var/run/php-fpm.sock touch /var/run/php-fpm.sock
mkdir /tmp/fastcgi /tmp/client_body mkdir /tmp/fastcgi /tmp/client_body