Skip to content

Commit 77a3b72

Browse files
committed
impr(entrypoint): Fix / disable shellcheck warnings
1 parent a977b4c commit 77a3b72

File tree

10 files changed

+80
-40
lines changed

10 files changed

+80
-40
lines changed

29/apache/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

29/fpm-alpine/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

29/fpm/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

30/apache/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

30/fpm-alpine/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

30/fpm/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

31/apache/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

31/fpm-alpine/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

31/fpm/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -eu
33

44
# version_greater A B returns whether A > B
@@ -67,8 +67,10 @@ file_env() {
6767
local var="$1"
6868
local fileVar="${var}_FILE"
6969
local def="${2:-}"
70-
local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
71-
local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
70+
local varValue
71+
local fileVarValue
72+
varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//")
73+
fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//")
7274
if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then
7375
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
7476
exit 1
@@ -80,7 +82,6 @@ file_env() {
8082
elif [ -n "${def}" ]; then
8183
export "$var"="$def"
8284
fi
83-
unset "$fileVar"
8485
}
8586

8687
if expr "$1" : "apache" 1>/dev/null; then
@@ -186,12 +187,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
186187
rsync_options="-rlD"
187188
fi
188189

190+
# shellcheck disable=SC2086
189191
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
190192
for dir in config data custom_apps themes; do
191193
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
194+
# shellcheck disable=SC2086
192195
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
193196
fi
194197
done
198+
# shellcheck disable=SC2086
195199
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
196200

197201
# Install

0 commit comments

Comments
 (0)