#!/bin/bash
command=""
timeout=""
while getopts "c:t:" flag; do
    case "${flag}" in
        c) command="${OPTARG}";;
        t) timeout="${OPTARG}";;
    esac
done
json_fmt='{"command": "%s", "timeout": "%s"}'
printf "$json_fmt" "$command" "$timeout" > "$TMT_REBOOT_REQUEST"
kill $PPID
