From f171c51616c7fe0a4817c0cf0b946dcdaaaec4d6 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 19 Dec 2010 22:15:26 +0100 Subject: add aif-report-issues.sh script --- Makefile | 5 +++-- README | 6 ++++++ src/aif-report-issues.sh | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100755 src/aif-report-issues.sh diff --git a/Makefile b/Makefile index 9327f65..194a358 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,9 @@ install: install -d $(DESTDIR)/usr/share/aif/tests install -d $(DESTDIR)/usr/lib/aif/core install -d $(DESTDIR)/usr/lib/aif/user - install -D -m755 src/aif.sh $(DESTDIR)/sbin/aif - install -D -m755 src/aif-test.sh $(DESTDIR)/sbin/aif-test + install -D -m755 src/aif.sh $(DESTDIR)/sbin/aif + install -D -m755 src/aif-test.sh $(DESTDIR)/sbin/aif-test + install -D -m755 src/aif-report-issues.sh $(DESTDIR)/sbin/aif-report-issues.sh install -D -m644 README $(DESTDIR)/usr/share/aif/docs install -D -m644 doc/* $(DESTDIR)/usr/share/aif/docs cp -rp src/core $(DESTDIR)/usr/lib/aif diff --git a/README b/README index 756bb1c..76fbb0e 100644 --- a/README +++ b/README @@ -31,6 +31,7 @@ Optionally: - xfsprogs: XFS support - ntp: setting date with NTP - dialog: for ncurses support + - curl: for the aif-report-issues.sh script ** Goals ** @@ -217,3 +218,8 @@ theory, it isn't always the case like that now, I need to do more refactoring) ** Test suite ** AIF also has a (WIP) test-suited. the source is the documentation. + +** Reporting issues / getting help ** + +Run the aif-report-issues.sh script, which will submit valuable (for debugging) +info to a public pastebin, you can then give the url to the people who need to help you diff --git a/src/aif-report-issues.sh b/src/aif-report-issues.sh new file mode 100755 index 0000000..18c91b2 --- /dev/null +++ b/src/aif-report-issues.sh @@ -0,0 +1,37 @@ +#!/bin/bash +RUNTIME_DIR=/tmp/aif +LOG_DIR=/var/log/aif +source /usr/lib/libui.sh +cat - </dev/null +ls -lh $LOG_DIR/* 2>/dev/null +report="Uploaded data:" +if ask_yesno "Send these files?" +then + shopt -s nullglob + for i in $RUNTIME_DIR/* $LOG_DIR/* + do + bin=$(cat $i | curl -sF 'sprunge=<-' http://sprunge.us) + bin=${bin/ /} # for some reason there is a space in the beginning + report="$report\n$i $bin" + done +fi + +echo "It can also be useful to upload a list of currently mounted filesystems:" +df -hT +if ask_yesno "Is this ok?" +then + bin=$(df -hT | curl -sF 'sprunge=<-' http://sprunge.us) + bin=${bin/ /} + report="$report\ndf -hT $bin" +fi +echo -e "$report" +echo "For your convenience, I will paste the report online" +echo "So you just need to give the following url:" +echo -e "$report" | curl -sF 'sprunge=<-' http://sprunge.us -- cgit v1.2.3-54-g00ecf