Skip to content

Commit b560eab

Browse files
committed
tee
1 parent 0deb4e0 commit b560eab

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

rootfs/container/functions/20-php-fpm

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ phpfpm_create_default_page() {
367367
if [ ! -f "${NGINX_WEBROOT}"/index.php ] ; then
368368
print_notice "Creating sample index.php"
369369
mkdir -p "${NGINX_WEBROOT}"
370-
cat <<EOF > "${NGINX_WEBROOT}"/index.php
370+
cat <<EOF | silent tee "${NGINX_WEBROOT}"/index.php
371371
<html>
372372
<title>Default Page</title>
373373
<h2>Container is working</h2>
@@ -381,7 +381,7 @@ EOF
381381

382382
phpfpm_configure_site_default() {
383383
if [ -z "${NGINX_SITE_ENABLED}" ] && [ ! -f "/etc/nginx/sites.available/default.conf" ] && [ -f "/container/init/init.d/20-php-fpm" ]; then
384-
cat <<EOF > /etc/nginx/sites.available/default.conf
384+
cat <<EOF | silent tee /etc/nginx/sites.available/default.conf
385385
server {
386386
### Don't Touch This
387387
listen ${NGINX_LISTEN_PORT};
@@ -390,6 +390,8 @@ phpfpm_configure_site_default() {
390390
### Populate your custom directives here
391391
index index.php index.html index.htm;
392392

393+
include ${NGINX_HEADER_FILE};
394+
393395
location / {
394396
try_files \$uri \$uri/ /index.php?\$args;
395397
}
@@ -488,8 +490,8 @@ phpfpm_configure_authentication_llng() {
488490
headers=NGINX_AUTHENTICATION_LLNG_ATTRIBUTE${llngheader}
489491
IFS=',' read -r -a array <<<"${!headers}"
490492
print_notice "Updating Nginx to support receiving attribute from LLNG: '${array[0]}'"
491-
echo "fastcgi_param ${array[0]} \$${array[1]};" >> /etc/nginx/snippets/authentication/llng-params
492-
echo "auth_request_set \$${array[1]} \$${array[2]};" >> /etc/nginx/snippets/authentication/llng-auth_request
493+
echo "fastcgi_param ${array[0]} \$${array[1]};" | silent tee -a /etc/nginx/snippets/authentication/llng-params
494+
echo "auth_request_set \$${array[1]} \$${array[2]};" | silent tee -a /etc/nginx/snippets/authentication/llng-auth_request
493495
done
494496
cp -R /etc/nginx/snippets/server.available/php-fpm.conf /etc/nginx/snippets/server.available/monitoring-php-fpm.conf
495497
sed -i "s|include /etc/nginx/snippets/server.available/php-fpm.conf;|include /etc/nginx/snippets/server.available/metrics-php-fpm.conf;|g" /etc/nginx/snippets/server.available/metrics.conf
@@ -572,7 +574,7 @@ phpfpm_configure_modules_xdebug() {
572574
mkdir "${PHP_MODULE_XDEBUG_PROFILER_PATH}"
573575
chown -R "${PHPFPM_USER}":"${PHPFPM_GROUP}" "${PHP_MODULE_XDEBUG_PROFILER_PATH}"
574576
if [ "${PHP_BASE:0:1}" = "5" ] || [ "${PHP_BASE:0:3}" = "7.0" ] || [ "${PHP_BASE:0:3}" = "7.1" ] ; then
575-
cat <<EOF >> "${php_prefix}"conf.available/xdebug.ini
577+
cat <<EOF | silent tee -a "${php_prefix}"conf.available/xdebug.ini
576578
zend_extension=xdebug.so
577579
xdebug.default_enable = 1
578580
xdebug.profiler_enable= ${PHP_MODULE_XDEBUG_PROFILER_ENABLE}
@@ -586,7 +588,7 @@ xdebug.remote_host = ${PHP_MODULE_XDEBUG_REMOTE_HOST}
586588
xdebug.remote_port = ${PHP_MODULE_XDEBUG_REMOTE_PORT}
587589
EOF
588590
else
589-
cat <<EOF >> "${php_prefix}"conf.available/xdebug.ini
591+
cat <<EOF | silent tee -a "${php_prefix}"conf.available/xdebug.ini
590592
zend_extension=xdebug.so
591593
xdebug.default_enable = 1
592594
xdebug.output_dir = ${PHP_MODULE_XDEBUG_OUTPUT_DIR}
@@ -612,13 +614,13 @@ phpfpm_configure_server_smtp() {
612614
case "$(container_info distro)" in
613615
"alpine" )
614616
if var_true "${CONTAINER_ENABLE_MESSAGING}" || [ "${CONTAINER_MESSAGING_BACKEND}" = "msmtp" ] ; then
615-
echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' > "${php_prefix%/}"/conf.d/99-smtp.ini
617+
echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' | silent tee "${php_prefix%/}"/conf.d/99-smtp.ini
616618
fi
617619
;;
618620
"debian" )
619621
if var_true "${ENABLE_SMTP}" || var_true "${CONTAINER_ENABLE_MESSAGING}" ; then
620-
echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' > "${php_root%/}"/cli/conf.d/99-smtp.ini
621-
echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' > "${php_prefix%/}"/conf.d/99-smtp.ini
622+
echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' | silent tee "${php_root%/}"/cli/conf.d/99-smtp.ini
623+
echo 'sendmail_path="/usr/bin/msmtp -C /etc/msmtprc -t "' | silent tee "${php_prefix%/}"/conf.d/99-smtp.ini
622624
fi
623625
;;
624626
esac
@@ -637,11 +639,11 @@ phpfpm_configure_server_timezone() {
637639
/container/data/php-fpm/fpm/php.ini
638640
case "$(container_info distro)" in
639641
"alpine" )
640-
echo "date.timezone=$(cat /etc/timezone)" > "${php_prefix%/}"/conf.d/99-timezone.ini
642+
echo "date.timezone=$(cat /etc/timezone)" | silent tee "${php_prefix%/}"/conf.d/99-timezone.ini
641643
;;
642644
"debian" )
643-
echo "date.timezone=$(cat /etc/timezone)" > "${php_root%/}"/cli/conf.d/99-timezone.ini
644-
echo "date.timezone=$(cat /etc/timezone)" > "${php_prefix%/}"/conf.d/99-timezone.ini
645+
echo "date.timezone=$(cat /etc/timezone)" | silent tee "${php_root%/}"/cli/conf.d/99-timezone.ini
646+
echo "date.timezone=$(cat /etc/timezone)" | silent tee "${php_prefix%/}"/conf.d/99-timezone.ini
645647
;;
646648
esac
647649
}

rootfs/etc/nginx/snippets/server.available/php-fpm.conf.x renamed to rootfs/etc/nginx/snippets/server.available/php-fpm.conf.z

File renamed without changes.

0 commit comments

Comments
 (0)