1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

openvpn/templates/iiab-support: Recap Ansible-vs-sed var mechanics

This commit is contained in:
root 2021-08-19 00:33:08 -04:00
parent 673b3be679
commit c1e5052722

View file

@ -33,9 +33,9 @@ read ans < /dev/tty
# (1) sed: Remove outer spacing IF NEC, then...
# (2) sed: Remove 1 pair of matching outer quotes (IF NEC)
# (3) Ansible vars can have non-string value null. SEE /opt/iiab/iiab/test.yml
# Here in bash, we focus only on string values, e.g. "" empty string if nec.
# Here in bash, we focus only on string values e.g. "" empty string if nec.
# (4) When writing to disk, we aggressively overwrite such null var lines, e.g.
# including sloppy unassigned var lines like "^var:$" that lacks whitespace.
# including sloppy unassigned var lines like "^var:$" that lack whitespace.
ans=$(echo $ans | sed "s/^\s*//; s/\s*$//; s/^\(['\"]\)\(.*\)\1$/\2/")