mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
openvpn/templates/iiab-support: Explain code paths/mechanics
This commit is contained in:
parent
40379df4b8
commit
5fcc91988c
1 changed files with 2 additions and 1 deletions
|
@ -46,6 +46,7 @@ if $($DEBUG); then
|
|||
echo "Your OpenVPN machine name -- source: $handle"
|
||||
fi
|
||||
|
||||
# Preview of steps (5) and (6)
|
||||
echo -ne "\e[1mYour OpenVPN machine name is set to: \e[100m"
|
||||
echo -n "$handle" | sed "s/^\(['\"]\)\(.*\)\1$/\2/; s/ /_/g" # Avoid '-e' interpreting backlash escapes, to show var accurately! Double quote var to prevent field splitting (eats spaces)
|
||||
echo -e "\e[0m\n" # Separate line also for trailing backslash in var
|
||||
|
@ -81,7 +82,7 @@ else
|
|||
# (3) sed: Strip '# comment' on right.
|
||||
ans=$(echo "$ans" | sed "s/#.*//") # Double quote var to prevent field splitting (eats spaces)
|
||||
# (4) sed: Strip any outer spacing, as Ansible would do.
|
||||
ans=$(echo "$ans" | sed "s/^\s*//; s/\s*$//")
|
||||
ans=$(echo "$ans" | sed "s/^\s*//; s/\s*$//") # Code Safety: lstrip not nec, given "read" command above, but one day $ans might arise from elsewhere
|
||||
|
||||
handle=$ans; # For display at bottom
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue