source: ProjectBuilder/projects/mondorescue/pbconf/branches/2.2.9/mondo/deb/bug/script@ 1330

Last change on this file since 1330 was 1330, checked in by Bruno Cornec, 13 years ago
  • Improve mondo Debian packages with some Debian upstream content (Andrée Leidenfrost/Rogério Brito)
File size: 2.4 KB
Line 
1#!/bin/sh -e
2#
3# Script for reporting bugs to Debian BTS for the mondo package
4#
5
6
7#
8# Configuration
9#
10MINDI_LOG="/var/log/mindi.log"
11MONDO_LOG="/var/log/mondo-archive.log"
12MAXSIZE=10485760
13
14
15#
16# Include a log file
17#
18IncludeLog() {
19 if [ -e "$1" ] ; then
20 printf "\nContents of $1:\n\n" >&3
21 if [ `stat -c "%s" $1` -le $MAXSIZE ]; then
22 cat "$1" >&3
23 else
24 echo "WARNING:"
25 echo "$1 exists but is larger than $MAXSIZE. Therefore"
26 echo "I will not include it."
27 echo "If you would like to attach it as described above you should terminate"
28 echo "this report without sending it and create a new one with the attachemnt."
29 echo "This is strongly recommended."
30 echo
31 printf "$1 not included because it is larger than $MAXSIZE bytes.\n" >&3
32 fi
33 else
34 printf "$MINDI_LOG does not exist.\n" >&3
35 fi
36 printf "\n=========================================================\n" >&3
37}
38
39
40#
41# Dialog for log files
42#
43clear
44echo "Package-specific Questions"
45echo
46echo "It is strongly suggested that you include log files $MINDI_LOG"
47echo "and $MONDO_LOG in your bug report. Due to their size,"
48echo "the best way to do this is to put them in a gzipped tar ball and attach"
49echo "this to the report. Alternatively, I can include the files in the report"
50echo "as text provided each is smaller than $MAXSIZE bytes."
51echo
52
53yesno "Have you attached the above logs? [y,N]" "nop"
54if [ "$REPLY" = "yep" ]; then
55 printf "$MINDI_LOG and $MONDO_LOG provided in attachment.\n" >&3
56else
57 yesno "May I include the above logs in the bug report? [Y,n]" "yep"
58 if [ "$REPLY" = "yep" ]; then
59 IncludeLog $MINDI_LOG
60 IncludeLog $MONDO_LOG
61 else
62 echo "You have chosen not to include the above logs. This will most likely"
63 echo "make it much harder to help you."
64 echo
65 printf "$MINDI_LOG and $MONDO_LOG not included as per user request.\n" >&3
66 fi
67fi
68
69
70#
71# Dialog for file system info
72#
73printf "\n\n" >&3
74printf "=========================================================\n" >&3
75echo "One cause of failure for mondo is that it runs out of diskspace."
76echo "I can include information about the fill state of your mounted filesystems."
77echo
78yesno "May I include information about the fill state of your mounted filesystems? [Y,n]" "yep"
79if [ "$REPLY" = "yep" ]; then
80 printf "Fileystem information:\n" >&3
81 df >&3
82else
83 printf "Fileystem information not included as per user request.\n" >&3
84fi
85
86
87#
88# End
89#
90exit 0
Note: See TracBrowser for help on using the repository browser.