forked from luciensadi/AwakeMUD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlucien_autorun
executable file
·72 lines (60 loc) · 2.24 KB
/
lucien_autorun
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#
# CircleMUD 2.0 autorun script
# Originally by Fred C. Merkel
# Copyright (c) 1993 The Trustees of The Johns Hopkins University
# All Rights Reserved
# See license.doc for more information
# Modifed by Christopher Dickey, Rift, Dunkelzahn, Demise, and Root.
# (c)2001 The AwakeMUD Consortium
# If .fastboot exists, the script will sleep for only 5 seconds between reboot
# attempts. If .killscript exists, the script commit suicide (and remove
# .killscript). If pause exists, the script will repeatedly sleep for
# 60 seconds and will not restart the mud until pause is removed.
# these sets are now nullified since we're starting awake from gdb alone now,
# changes go in utils/gdbcmds
while true; do
rm -f syslog.txt
touch syslog.txt
echo "autoscript starting game $(date)" | tee syslog.txt
# Takes advantage of the config done in ~/.gdbinit (not replicated here).
gdb -batch -ex "run" -ex "bt" -ex "quit" -ex "yes" bin/awake < /dev/null |& tee syslog.txt
echo "" >> syslog.txt
tail -n 500 syslog.txt >> log/crashlog
echo "" >> log/crashlog
fgrep "self-delete" syslog.txt >> log/delete
fgrep "Running" syslog.txt >> log/restarts
fgrep "advanced" syslog.txt >> log/levels
fgrep "equipment lost" syslog.txt >> log/rentgone
fgrep "usage" syslog.txt >> log/usage
fgrep "CONNLOG" syslog.txt >> log/connlog
fgrep "MISCLOG" syslog.txt >> log/misclog
fgrep "SYSLOG" syslog.txt >> log/syslog
fgrep "WIZLOG" syslog.txt >> log/wizlog
fgrep "DEATHLOG" syslog.txt >> log/deathlog
fgrep "CHEATLOG" syslog.txt >> log/cheatlog
fgrep "Bad PW" syslog.txt >> log/badpws
# here we mail the syslog to whoever the admin is so they know the
# mud crashed (if it crashed at all)
# These aren't needed as the mud runs in GDB now.
# mv -f lib/core.1 lib/core.2 >>& ~/awake.out
# mv -f lib/core lib/core.1 >>& ~/awake.out
rm log/syslog.6
mv log/syslog.5 log/syslog.6
mv log/syslog.4 log/syslog.5
mv log/syslog.3 log/syslog.4
mv log/syslog.2 log/syslog.3
mv log/syslog.1 log/syslog.2
mv syslog.txt log/syslog.1
touch syslog.txt
sleep 5
if [ -e .killscript ]; then
set DATE = $(date)
echo "autoscript killed $(date)" >> syslog.txt
rm .killscript
exit
fi
while [ -e pause ]; do
sleep 10
done
done