Skip to content

Commit ababef7

Browse files
authored
Revert "Simplify first character check in entrypoint.sh (nextcloud#1679)" nextcloud#1699 (nextcloud#1701)
.In php:8.0-fpm-bullseye /bin/sh is dash, which does not support "${X:0:1}" (substring expansion). This reverts commit 0536522. Signed-off-by: Doncho N. Gunchev <[email protected]>
1 parent 4b7b164 commit ababef7

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

21/apache/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

21/fpm-alpine/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

21/fpm/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

22/apache/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

22/fpm-alpine/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

22/fpm/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

23/apache/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

23/fpm-alpine/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

23/fpm/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
5757
file_env REDIS_HOST_PASSWORD
5858
echo 'session.save_handler = redis'
5959
# check if redis host is an unix socket path
60-
if [ "${REDIS_HOST:0:1}" = "/" ]; then
60+
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
6161
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
6262
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
6363
else

0 commit comments

Comments
 (0)