forked from protomuck/protomuck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fbupgrade
executable file
·196 lines (164 loc) · 5.6 KB
/
fbupgrade
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/bin/csh -f
#
# Change the FBDIR to point towards the game/ directory of your old
# FuzzBallMUCK. This should be the file with the restart script, muf dir,
# logs dir, etc.
#
set HOME = $HOME
set FBDIR = $HOME/fb5.66/game
#
# Make sure that this points to the game/ directory of your new copy
# of ProtoMUCK.
#
set PROTODIR = $HOME/proto/game
set PROTOSRC = $HOME/proto/src
#
# If your FuzzBall directories were not changed from the standard
# configuration, you should not need to change anything below. Note
# that only one copy of the data base is essential, either std-db.db
# or std-db.new. If one or the other is missing, the upgrade will still
# run fine.
#
set MUFDIR = $FBDIR/muf
set LOGSDIR = $FBDIR/logs
set DBOLD = $FBDIR/data/std-db.db
set DBNEW = $FBDIR/data/std-db.new
set WELCOMET = $FBDIR/data/welcome.txt
set NEWST = $FBDIR/data/news.txt
set NEWSD = $FBDIR/data/news
set MOTD = $FBDIR/data/motd.txt
set MPIHELPD = $FBDIR/data/mpihelp
set MAND = $FBDIR/data/man
set INFOD = $FBDIR/data/info
set HELPD = $FBDIR/data/help
set CONNECT = $FBDIR/data/connect.txt
set PARMFILE = $FBDIR/data/parmfile.cfg
################################################################
#
# You should not have to change anything below here.
#
################################################################
echo "---------------------------------------------"
echo "FuzzBall5.xx ---> ProtoMUCK AutoUpgrade "
echo "---------------------------------------------"
#Check for the proto/src directory. If there, compile.
if ( -r $PROTOSRC ) then
if ( -r $PROTODIR/protomuck ) then
rm $PROTODIR/protomuck
endif
echo "Runing configuration script."
cd $PROTOSRC
./configure
cd $PROTODIR/..
echo "Running make depend then make install"
make depend -C $PROTOSRC
make install -C $PROTOSRC
if (! -r $PROTODIR/protomuck ) then
echo "Error in compiling. Cancelling upgrade."
exit 0
endif
endif
echo " "
echo "Now copying over from $FBDIR"
echo " "
#Check for the neon/game game directory.
if (! -r $FBDIR ) then
echo "No Neon directory found to upgrade."
echo "Check FBDIR path."
exit 0
endif
#check for a std-db.db or std-db.new to upgrade from
if (! -r $DBOLD & ! -r $DBNEW ) then
echo "You need a data base to upgrade from."
echo "Check the paths set above for std-db.db or std-db.new."
exit 0
endif
#check for MUF dir. Wouldn't be a good upgrade without it.
if (! -r $MUFDIR ) then
echo "MUF directory not found. Dangerous to upgrade with out."
echo "Check the paths set above for the muf directory"
exit 0
endif
#The rest of the files aren't essential to an upgrade, so are not
#checked for.
echo "Copying std-db.db and std-db.new and renaming to"
echo "proto.db and proto.new"
cp -f $DBOLD $PROTODIR/data/proto.db
cp -f $DBNEW $PROTODIR/data/proto.new
echo "Copying all MUF code to $PROTODIR/"
cp -f -R $MUFDIR $PROTODIR/
#Got the essentials done, now copy the rest.
echo " "
echo " "
if ( -r $PARMFILE ) then
echo "Copying @tune parameters as parmfile.cfg to $PROTODIR/data/"
cp -f $PARMFILE $PROTODIR/data/
endif
if ( -r $LOGSDIR ) then
echo "Copying contents of log directory to $PROTODIR/log/"
cp -f -r $LOGSDIR $PROTODIR/
endif
if ( -r $WELCOMET ) then
echo "Copying welcome.txt to $PROTODIR/data/"
cp -f $WELCOMET $PROTODIR/data/
endif
if ( -r $NEWST ) then
echo "Copying news.txt to $PROTODIR/data/"
cp -f $NEWST $PROTODIR/data/
endif
if ( -r $NEWSD ) then
echo "Copying news directory to $PROTODIR/data/news/"
cp -f -r $NEWSD $PROTODIR/data/
endif
if ( -r $MOTD ) then
echo "Copying motd.txt to $PROTODIR/data/"
cp -f $MOTD $PROTODIR/data/
endif
if ( -r $CONNECT ) then
echo "Copying connect.txt to $PROTODIR/data/ directory."
cp -f $CONNECT $PROTODIR/data/
endif
if ( -r $MPIHELPD ) then
echo "Copying mpihelp directory to $PROTODIR/data/mpihelp/"
cp -f -r $MPIHELPD $PROTODIR/data/
endif
if ( -r $MAND ) then
echo "Copying man directory to $PROTODIR/data/man/"
cp -f -r $MAND $PROTODIR/data/
endif
if ( -r $INFOD ) then
echo "Copying info directory to $PROTODIR/data/info/"
cp -f -r $INFOD $PROTODIR/data/
endif
if ( -r $HELPD ) then
echo "Copying help directory to $PROTODIR/data/help/"
cp -f -r $HELPD $PROTODIR/data/
endif
echo " "
if ( -r $PROTODIR/data/proto.new ) then
echo "**std-db.new found, copying over proto.db**"
cp -f $PROTODIR/data/proto.new $PROTODIR/data/proto.db
endif
echo " "
echo "Converting FuzzBall data base to Proto."
cd $PROTODIR
./protomuck -convert data/proto.db data/proto.db
cd ..
touch game/logs/status
echo "`date` - `who am i` ran the Neon --> Proto upgrade script." >> game/logs/status
echo " "
echo " "
echo "--------------------------------------------------"
echo " Welcome to ProtoMUCK"
echo "--------------------------------------------------"
echo " "
echo "If you are seeing this message, then your upgrade "
echo "from FB5.xx went smoothly. You should -NEVER- "
echo "run this script again once starting up your copy "
echo "of Proto. Doing so may result in the loss of your "
echo "database."
echo "Check the settings in the $PROTODIR/restart "
echo "script to make sure the locations are correct."
echo "**MAKE SURE THE OLD COPY OF FB5.xx IS SHUT DOWN.**"
echo "Then change to $HOME/proto/ and type ./proto start"
echo "to start the MUCK."