diff --git a/docs/chapters/template.rst b/docs/chapters/template.rst index 463fccbf..e3a7d5f1 100644 --- a/docs/chapters/template.rst +++ b/docs/chapters/template.rst @@ -45,9 +45,15 @@ Template Automation Hooks | SYSRC | sysrc command(s) | nginx_enable=YES | +---------+-------------------+-----------------------------------------+ -Note: SYSRC requires that NO quotes be used or that quotes (`"`) be escaped +Special Hook Cases +------------------ + +SYSRC requires that NO quotes be used or that quotes (`"`) be escaped ie; (`\\"`) +ARG will always treat an ampersand "\&" literally, without the need to escape it. +Escaping it will cause errors. + Place these uppercase template hook commands into a `Bastillefile` in any order and automate container setup as needed. diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 3aed8664..9e4f42b2 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -54,7 +54,7 @@ get_arg_name() { parse_arg_value() { # Parses the value after = and then escapes back/forward slashes and single quotes in it. -- cwells - echo "${1}" | sed -E 's/[^=]+=?//' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/'\''/'\''\\'\'\''/g' + echo "${1}" | sed -E 's/[^=]+=?//' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/'\''/'\''\\'\'\''/g' -e 's/&/\\&/g' -e 's/"//g' } get_arg_value() {