aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh')
-rwxr-xr-xkubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/kubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh b/kubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh
index 6c69694011..71f32e2eff 100755
--- a/kubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh
+++ b/kubernetes/clamp/charts/mariadb/resources/config/init/docker-entrypoint.sh
@@ -18,6 +18,11 @@ for arg; do
esac
done
+prepare_password()
+{
+ echo "$1" | sed -e "s/'/\\\\'/g; s/\"/\\\\\"/g"
+}
+
# usage: file_env VAR [DEFAULT]
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
@@ -36,7 +41,7 @@ file_env() {
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
- val=`echo -n $val | sed -e "s/'/''/g"`
+ val=`prepare_password $val`
export "$var"="$val"
unset "$fileVar"
}