From c870dbfc13ffaf443b742eeabb4b24062cd930b3 Mon Sep 17 00:00:00 2001 From: Steffen Ritter Date: Wed, 16 Jun 2021 15:36:31 +0200 Subject: [debug-report] New argument "--local" Instead of sending a report it can sometimes also help to gather relevant logs and just save them e.g. when sending is not possible (no internet, ...) --- .../data/opt/openslx/bin/debug_report | 26 ++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report b/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report index 2dbb45d1..9dd11b5f 100755 --- a/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report +++ b/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report @@ -24,13 +24,17 @@ if [ "$UID" != "0" ]; then exit 1 fi -for URL in $URLS; do - if [ "$URL" = "end" ]; then - echo "Kann den Debug-Report-Server in Freiburg nicht erreichen. :-(" >&2 - exit 1 - fi - curl -L -H "Expect:" -f -s -S --connect-timeout 5 "$URL" > /dev/null && break -done +if [ "$1" = "--local" ]; then + localReport=true +else + for URL in $URLS; do + if [ "$URL" = "end" ]; then + echo "Kann den Debug-Report-Server in Freiburg nicht erreichen. :-(" >&2 + exit 1 + fi + curl -L -H "Expect:" -f -s -S --connect-timeout 5 "$URL" > /dev/null && break + done +fi rm -rf /tmp/debug-report mkdir -p /tmp/debug-report/{static/proc,generated} @@ -143,6 +147,14 @@ echo "..fertig!" cd /tmp rm -f -- error-report.tar.gz + +if [ "$localReport" = "true" ]; then + dirname="debug-report-$(date +"%Y-%m-%d_%H-%M-%S")" + mv debug-report "$dirname" + echo "Fehlerbericht wird NICHT versendet und liegt unter: $(pwd)/$dirname" + exit +fi + echo -n "Packe Fehlerbericht ein..." if ! tar czf error-report.tar.gz debug-report; then echo "Fehler beim Packen des Berichts!" >&2 -- cgit v1.2.3-55-g7522