Commit 1016ab4e authored by Ryan Lee's avatar Ryan Lee

correct command escaping

parent f5344fe0
...@@ -52,7 +52,7 @@ object NotificationCommand "statuspage-notifications-command" { ...@@ -52,7 +52,7 @@ object NotificationCommand "statuspage-notifications-command" {
log(LogDebug, "statuspage-notifications", "Generating notification command") log(LogDebug, "statuspage-notifications", "Generating notification command")
var statuspage_payload = "component[status]=" + component_status var statuspage_payload = "component[status]=" + component_status
var payload_argument = escape_shell_arg(statuspage_payload) var payload_argument = escape_shell_arg(statuspage_payload)
var statuspage_api_key_argument = escape_shell_arg(statuspage_api_key) var statuspage_api_key_argument = escape_shell_arg("Authorization: OAuth " + statuspage_api_key)
var statuspage_api_url_argument = escape_shell_arg(statuspage_api_url + "/components/" + component_id + ".json") var statuspage_api_url_argument = escape_shell_arg(statuspage_api_url + "/components/" + component_id + ".json")
var cmd = [ var cmd = [
"curl", "curl",
...@@ -61,8 +61,8 @@ object NotificationCommand "statuspage-notifications-command" { ...@@ -61,8 +61,8 @@ object NotificationCommand "statuspage-notifications-command" {
"--max-time", "60", "--max-time", "60",
"--silent", "--show-error", "--silent", "--show-error",
"-X", "PATCH", "-X", "PATCH",
"-H", "'Authorization: OAuth " + statuspage_api_key_argument + "'", "-H", statuspage_api_key_argument,
"-d", "component[status]=" + payload_argument, "-d", payload_argument,
statuspage_api_url_argument statuspage_api_url_argument
] ]
var notification_command = cmd.join(" ") var notification_command = cmd.join(" ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment