mirror of https://github.com/lukechilds/umbrel.git
Lounès Ksouri
4 years ago
committed by
GitHub
3 changed files with 29 additions and 1 deletions
@ -0,0 +1,25 @@ |
|||||
|
#!/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" |
Loading…
Reference in new issue