forked from luciensadi/AwakeMUD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrash_report.sh
More file actions
executable file
·46 lines (37 loc) · 879 Bytes
/
crash_report.sh
File metadata and controls
executable file
·46 lines (37 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Written by Daniel Lowe, 2008
# https://github.com/TempusMUD/Tempuscode/blob/master/bin/crash_report.sh
# Modified for AwakeMUD CE by Finster
LINECOUNT=`wc -l $0 | awk '{print $1}'`
CUTLINE=`grep --line-number "^\# GDB COMMAND LIST CUT HERE" $0 | awk -F: '{print $1}'`
TAILCOUNT=`echo $((LINECOUNT-CUTLINE))`
echo " >>>>"
echo " >>>> MUD CRASH REPORT <<<<"
echo " >>>> `date`"
echo " >>>>"
echo
echo " >>>>"
echo " >>>> TAIL of last syslog (log/syslog.0)"
echo " >>>>"
echo
tail $2
echo
echo " >>>>"
echo " >>>> GDB OUTPUT"
echo " >>>>"
echo
tail -${TAILCOUNT} $0 > /tmp/awake.crash.cmds
gdb bin/awake $1 </tmp/awake.crash.cmds
chmod g+r $1
exit
# gbd coms
#
# GDB COMMAND LIST CUT HERE
set prompt \n
set print null-stop on
set print pretty on
printf " >>>>\n >>>> STACK TRACE\n >>>>\n"
bt
printf " >>>>\n >>>> LAST CMD ISSUED\n >>>>\n"
print last_cmd
quit