Skip to content

Commit 477b257

Browse files
authored
fix: Addressing an issue with quotations appearing in the docker environment variables (#182)
# Fix docker environment variable quotes ## Description Addressing an issue with quotations appearing in the docker environment variables. ## Type of Change Please select the type of change your pull request introduces: - [x] Bugfix - [ ] New feature - [ ] Documentation update - [ ] Other (please describe): ## Checklist - [x] This PR conforms to the process detailed in the [Contributing Guide](https://sandialabs.github.io/firewheel/developer/contributing.html). - [x] I have included no proprietary/sensitive information in my code. - [x] I have performed a self-review of my code. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have made corresponding changes to the documentation. - [x] My changes generate no new warnings. - [x] I have tested my code.
1 parent f11f385 commit 477b257

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docker/fsroot/start-minimega.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@ fi
1919
if [[ -f "/etc/default/minimega" ]]; then
2020
# Check if any variables are already set
2121
while IFS='=' read -r key value; do
22-
# Only set the variable if it is not already set
23-
if [[ -z "${!key}" ]]; then
24-
export "$key"="$value"
22+
# Skip empty lines and comments
23+
if [[ -n "$key" && -n "$value" && "$key" != \#* ]]; then
24+
# Remove surrounding quotes
25+
value="${value%\"}"
26+
value="${value#\"}"
27+
28+
# Only set the variable if it is not already set
29+
if [[ -z "${!key}" ]]; then
30+
export "${key}=${value}"
31+
fi
2532
fi
2633
done < <(grep -v '^#' "/etc/default/minimega")
2734
fi

0 commit comments

Comments
 (0)