fix: unquote PAYLOAD heredoc so runtime vars are expanded
The inner PAYLOAD heredoc had a quoted delimiter ('PAYLOAD') which
prevented runtime variable expansion. Changed to unquoted (PAYLOAD)
so $AGENT_KEY, $CPU, etc. are correctly expanded at runtime.
The double-escaping works as:
install time (outer EOF): $AGENT_KEY → (in file)
runtime (inner PAYLOAD): → abc123... (actual value)
This commit is contained in:
@@ -62,7 +62,7 @@ collect_metrics() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
push_metrics() {
|
push_metrics() {
|
||||||
payload=\$(cat << 'PAYLOAD'
|
payload=\$(cat << PAYLOAD
|
||||||
{
|
{
|
||||||
"agent_key": "\$AGENT_KEY",
|
"agent_key": "\$AGENT_KEY",
|
||||||
"cpu": \$CPU,
|
"cpu": \$CPU,
|
||||||
|
|||||||
Reference in New Issue
Block a user