initscripts fkt: Ignore comments in readhash

As '#Another Comment' is a valid key we test this change by checking if
the comments do not end up as keys in our array.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Jonatan Schlag
2024-06-16 18:02:39 +02:00
committed by Michael Tremer
parent 59e3c2a217
commit d289bc28be
3 changed files with 14 additions and 0 deletions

View File

@@ -905,6 +905,11 @@ readhash() {
continue
fi
# Skip Comments
if [[ ${line} =~ ^#.*$ ]]; then
continue
fi
local key="${line%=*}"
local val="${line#*=}"