2023-02-13 09:44:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [[ "${1}" =~ ^nextcloud ]]; then
|
|
|
|
container=${1}
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
container="nextcloud_app_1"
|
|
|
|
fi
|
|
|
|
|
2023-03-13 12:59:53 +00:00
|
|
|
|
2023-02-13 09:44:56 +00:00
|
|
|
oc_list=$(env| grep 'OC_')
|
|
|
|
if [[ "x${oc_list}" != "x" ]]; then
|
|
|
|
for row in $(echo "${oc_list}"); do
|
|
|
|
MY_VARS="${MY_VARS} -e ${row}"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2024-04-22 10:05:07 +00:00
|
|
|
if [[ ${1} == 'config:editable' ]]; then
|
|
|
|
echo "config:editable is deprecated"
|
2023-03-24 12:24:23 +00:00
|
|
|
exit 0
|
2023-03-13 12:59:53 +00:00
|
|
|
fi
|
2024-04-22 10:05:07 +00:00
|
|
|
docker exec ${container} chmod u+w /var/www/html/config/
|
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} sh -c 'sed "s/config_is_read_only\(.\) => true,/config_is_read_only\1 => false,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp'
|
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} cp /var/www/html/config/config.php.tmp /var/www/html/config/config.php
|
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} rm /var/www/html/config/config.php.tmp
|
2023-03-24 12:24:23 +00:00
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} php --define apc.enable_cli=1 /var/www/html/occ "$@"
|
2024-04-22 10:05:07 +00:00
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} sh -c 'sed "s/config_is_read_only\(.\) => false,/config_is_read_only\1 => true,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp'
|
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} cp /var/www/html/config/config.php.tmp /var/www/html/config/config.php
|
|
|
|
docker exec -ti ${MY_VARS} -u www-data ${container} rm /var/www/html/config/config.php.tmp
|
|
|
|
docker exec ${container} chmod u-w /var/www/html/config/
|
|
|
|
exit 0
|
|
|
|
|
2023-03-24 12:24:23 +00:00
|
|
|
|