Standardise logic so it works cross-distro

This commit is contained in:
TheSpad 2022-08-28 18:12:20 +01:00
parent 7b8515c27e
commit ea7f9dddff
No known key found for this signature in database
GPG key ID: 08F06191F4587860

View file

@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
# shellcheck shell=bash # shellcheck shell=bash
if [[ "$(find /var/run/s6/container_environment/ -maxdepth 1 -print0 | xargs)" == *"FILE__"* ]]; then if [[ "$(find /var/run/s6/container_environment/*"FILE__"* -maxdepth 1 2>/dev/null)" ]]; then
for FILENAME in /var/run/s6/container_environment/*; do for FILENAME in /var/run/s6/container_environment/*; do
if [[ "${FILENAME##*/}" == "FILE__"* ]]; then if [[ "${FILENAME##*/}" == "FILE__"* ]]; then
SECRETFILE=$(cat "${FILENAME}") SECRETFILE=$(cat "${FILENAME}")