diff options
author | Simon Rettberg | 2023-02-15 14:06:37 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-02-15 14:06:37 +0100 |
commit | 5b9b6921d120c462754985f2969c4121dd2d97af (patch) | |
tree | f656ac129513ca442f4393ba170ff07f5aa80419 /core | |
parent | [remote-access/hardware-stats] Try harder to avoid races and keep order (diff) | |
download | mltk-5b9b6921d120c462754985f2969c4121dd2d97af.tar.gz mltk-5b9b6921d120c462754985f2969c4121dd2d97af.tar.xz mltk-5b9b6921d120c462754985f2969c4121dd2d97af.zip |
[debug-report-bwlp] Add useful params to some tools
Also add a fallback for determining XAUTHORITY
Diffstat (limited to 'core')
-rwxr-xr-x | core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report | 13 |
1 files changed, 7 insertions, 6 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 565ec026..00eca9d6 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 @@ -1,17 +1,17 @@ #!/bin/bash # bash because of {,} expansion -TOOLS=" - journalctl +TOOLS=( + "journalctl -a" systemctl loginctl - lspci + "lspci -nn" lsusb lsmod mount dmesg dmidecode -" +) URLS=" https://bwlp-masterserver.ruf.uni-freiburg.de/error_report.php @@ -107,8 +107,8 @@ cp /run/openslx/*log* /run/openslx/dmsetup.state static/ 2> /dev/null cp -r /opt/openslx/.mltk static/ 2> /dev/null echo -n "." -for tool in $TOOLS; do - $tool > "generated/${tool}-out" 2> "generated/${tool}-err" +for tool in "${TOOLS[@]}"; do + $tool > "generated/${tool%% *}-out" 2> "generated/${tool%% *}-err" echo -n "." done @@ -142,6 +142,7 @@ echo -n "." if [ -z "$DISPLAY" ]; then DISPLAY=:0 XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') + [ -z "$XAUTHORITY" ] && [ -s "/run/lightdm/root/:0" ] && XAUTHORITY="/run/lightdm/root/:0" fi if [ -n "$XAUTHORITY" ]; then export DISPLAY |