You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
684 B

#!/usr/bin/env bash
UMBREL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)"
DEBUG_SCRIPT="${UMBREL_ROOT}/scripts/debug"
cat <<EOF > "${UMBREL_ROOT}/statuses/debug-status.json"
{"status": "processing"}
EOF
json_encode () {
jq --null-input --raw-input 'reduce inputs as $line (""; . += "\($line)\n")'
}
debug_json_string=$("${DEBUG_SCRIPT}" --dashboard | sed '/onion/d' | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | json_encode)
dmesg_json_string=$(dmesg | json_encode)
cat <<EOF > "${UMBREL_ROOT}/statuses/debug-status.json"
{
"status": "success",
"debug": ${debug_json_string},
"dmesg": ${dmesg_json_string}
}
EOF
echo "Debug result file generated"