406 if (json_object_object_get_ex(jobj, "metric", &metric)) { |
406 if (json_object_object_get_ex(jobj, "metric", &metric)) { |
407 if ((json_object_object_get_ex(metric, "Node Control/Reboot", &val)) && (strcmp(message_type, "NCMD") == 0)) { |
407 if ((json_object_object_get_ex(metric, "Node Control/Reboot", &val)) && (strcmp(message_type, "NCMD") == 0)) { |
408 if (json_object_get_boolean(val) == true) { |
408 if (json_object_get_boolean(val) == true) { |
409 syslog(LOG_NOTICE, "MQTT: `Node Control/Reboot' command"); |
409 syslog(LOG_NOTICE, "MQTT: `Node Control/Reboot' command"); |
410 /* |
410 /* |
411 * Reboot. The erver process will restart which is handled |
411 * Restart. The server process will restart which is handled |
412 * in the main thread loop. |
412 * in the main thread loop. |
413 */ |
413 */ |
414 my_reboot = my_shutdown = TRUE; |
414 my_reboot = my_shutdown = TRUE; |
415 return; |
415 return; |
416 } |
416 } |