mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2024-11-23 12:01:51 +01:00
Add helper for loading secrets
This commit is contained in:
parent
b7e9ab4d5c
commit
53c16e53c3
21
rootfs/usr/local/bin/load_secrets
Executable file
21
rootfs/usr/local/bin/load_secrets
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
load_dir_env() {
|
||||||
|
local dir="$1"
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
|
||||||
|
for file in "$dir"/*; do
|
||||||
|
if [ -f "$file" ] && [[ "$(basename "$file")" != *=* ]]; then
|
||||||
|
varName="$(basename "$file")"
|
||||||
|
value="$(<"$file")"
|
||||||
|
export "${varName}=${value}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
load_dir_env /run/secrets_normalized
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
Loading…
Reference in New Issue
Block a user