ncp-templates: Fix erroneous outputs messing up config files

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
thecalcaholic 2022-09-16 00:37:16 +02:00
parent 7225c2c898
commit ea75a97a91
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
6 changed files with 8 additions and 8 deletions

View File

@ -5,16 +5,16 @@ source /usr/local/etc/library.sh
if [[ "$1" == "--defaults" ]] if [[ "$1" == "--defaults" ]]
then then
echo -e "INFO: Restoring template to default settings" echo "INFO: Restoring template to default settings" >&2
DB_DIR=/var/lib/mysql DB_DIR=/var/lib/mysql
else else
if [[ "$DOCKERBUILD" -eq 1 ]] if [[ "$DOCKERBUILD" -eq 1 ]]
then then
echo -e "INFO: Docker build detected." echo "INFO: Docker build detected." >&2
DB_DIR=/data-ro/database DB_DIR=/data-ro/database
elif is_docker elif is_docker
then then
echo -e "INFO: Docker container detected." echo "INFO: Docker container detected." >&2
DB_DIR=/data/database DB_DIR=/data/database
else else
DB_DIR="$(source "${BINDIR}/CONFIG/nc-database.sh"; tmpl_db_dir)" DB_DIR="$(source "${BINDIR}/CONFIG/nc-database.sh"; tmpl_db_dir)"

View File

@ -5,7 +5,7 @@ source /usr/local/etc/library.sh
if [[ "$1" == "--defaults" ]] if [[ "$1" == "--defaults" ]]
then then
echo -e "INFO: Restoring template to default settings" echo "INFO: Restoring template to default settings" >&2
INNODB_BUFFER_POOL_SIZE=256M INNODB_BUFFER_POOL_SIZE=256M
else else
INNODB_BUFFER_POOL_SIZE="$(source "${BINDIR}/CONFIG/nc-limits.sh"; tmpl_innodb_buffer_pool_size)" INNODB_BUFFER_POOL_SIZE="$(source "${BINDIR}/CONFIG/nc-limits.sh"; tmpl_innodb_buffer_pool_size)"

View File

@ -54,7 +54,7 @@ EOF
is_docker || { is_docker || {
DATADIR=$( get_nc_config_value datadirectory ) || { DATADIR=$( get_nc_config_value datadirectory ) || {
echo -e "ERROR: Could not get data directory. Is NextCloud running?"; echo "ERROR: Could not get data directory. Is NextCloud running?" >&2
return 1; return 1;
} }
NC_SNAPSHOTS_DIR="$(dirname "$DATADIR")/ncp-snapshots" NC_SNAPSHOTS_DIR="$(dirname "$DATADIR")/ncp-snapshots"

View File

@ -140,6 +140,6 @@ cat <<EOF
EOF EOF
if ! [[ -f /.ncp-image ]]; then if ! [[ -f /.ncp-image ]]; then
echo -e "Apache self check:" echo "Apache self check:" >&2
apache2ctl -t 1>&2 apache2ctl -t 1>&2
fi fi

View File

@ -7,7 +7,7 @@ PHPVER="${PHPVER?ERROR: PHPVER variable unset!}"
if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]] if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]]
then then
echo -e "INFO: Restoring template to default settings" echo "INFO: Restoring template to default settings" >&2
TMP_DIR="/tmp" TMP_DIR="/tmp"
else else

View File

@ -7,7 +7,7 @@ PHPVER="${PHPVER?ERROR: PHPVER variable unset!}"
if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]] if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-datadir.sh" ]]
then then
echo -e "INFO: Restoring template to default settings" echo "INFO: Restoring template to default settings" >&2
PHPTHREADS=6 PHPTHREADS=6
else else