hooks/instsoft.GRMLBASE: ensure aptitude is available before invoking it
[grml-live.git] / etc / grml / fai / config / hooks / savelog.LAST.source
1 #!/bin/bash
2
3 # parse all log files for error messages
4 # print errors and warnings found to error.log
5 # WARNING: This will only work with english error messages!
6
7 errfile=$LOGDIR/error.log
8
9 # Define grep patterns. Do not start or end with an empty line!
10 globalerrorpatterns="error
11 fail
12 warn
13 bad
14 no space
15 syntax
16 Couldn't stat
17 Cannot access
18 is bigger than the limit
19 did not exist
20 non existent
21 not found
22 couldn't
23 can't
24 E: Sorry, broken packages
25 operator expected
26 ambiguous redirect
27 No previous regular expression
28 No such
29 Device or resource busy
30 unknown option
31 [a-z]\+\.log:E: 
32 No candidate version found
33 segfault
34 cannot create"
35
36 globalignorepatterns="[a-z]\+\.log:# 
37 libroxen-errormessage
38 liberror-perl
39 libgpg-error-dev
40 libgpg-error0
41 ^fstab.\+errors=remount
42 [RT]X packets:
43 WARNING: unexpected IO-APIC
44 warned about = ( )
45 daemon.warn
46 kern.warn
47 rw,errors=
48 Expect some cache
49 no error
50 failmsg
51 RPC call returned error 101
52 deverror.out
53 (floppy), sector 0
54 mount version older than kernel
55 Can't locate module 
56 Warning only 896MB will be used.
57 hostname: Host name lookup failure
58 I can't tell the difference.
59 warning, not much extra random data, consider using the -rand option
60 confC._FILE
61 Warning: 3 database(s) sources
62 were not found, (but were created)
63 removing exim
64 The home dir you specified already exists.
65 No Rule for /usr/lib/ispell/default.hash.
66 /usr/sbin/update-fonts-.\+: warning: absolute path
67 hostname: Unknown server error
68 EXT2-fs warning: checktime reached
69 RPC: sendmsg returned error 101
70 can't print them to stdout. Define these classes
71 warning: downgrading
72 suppress emacs errors
73 echo Error: 
74 Can't open dependencies file
75 documents in /usr/doc are no longer supported
76 if you have both a SCSI and an IDE CD-ROM
77 Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon
78 Monitoring disabled
79 kernel-patch-badram
80 Error: only one processor found.
81 Error Recovery Strategy:
82 sector 0 does not have an
83 syslogin_perform_logout: logout() returned an error
84 grub is not in an XFS filesystem.
85 is harmless
86 not updating .\+ font directory data.
87 register_serial(): autoconfig failed
88 Fontconfig error: Cannot load default config file
89 asking for cache data failed
90 However, I can not read the target:
91 fai-kernels/modules.dep: No such file
92 Warning: The partition table looks like it was made
93 task_error=0
94 ^info: Trying to set 
95 warning: /usr/lib/X11/fonts
96 gstreamer0.10-plugins-bad
97 can't read /etc/udev/rules.d/z25_persistent-net.rules
98 /cow': No such file or directory
99 cdrom: open failed."
100 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
101 # Here you can define your own patterns. Put one pattern in a line,
102 # do not create empty lines.
103 myerrorpatterns="XXXXX"
104 myignorepatterns="XXXXX"
105 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106 # The main routine
107 errorpatterns="$globalerrorpatterns
108 $myerrorpatterns"
109 ignorepatterns="$globalignorepatterns
110 $myignorepatterns"
111
112 cd $LOGDIR || exit 3
113 if [ -s $errfile ]; then
114     echo "Errorfile already exists. Aborting."
115     exit
116 fi
117
118 grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
119
120 if [ -s $errfile ]; then
121    echo "ERRORS found in log files. See $errfile."
122 else
123    echo "Congratulations! No errors found in log files."
124    export flag_reboot=1
125 fi