-
Notifications
You must be signed in to change notification settings - Fork 100
/
InstallUNIX.sh
174 lines (150 loc) · 8.19 KB
/
InstallUNIX.sh
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
#!/bin/sh
#The following either will echo (send to display), read (get in a variable) or sleep (wait for a #few seconds).
#Written by: Wolf a.k.a. TheOneWolf a.k.a. TheSimDude a.k.a. The_One a.k.a. Wolfgang Richter
#If you have a problem...e-mail the ghostbusters...I mean...e-mail [email protected] :)
#VERSION: TEST5
echo "Hello, and welcome to the UNIX CoffeeMud automated installer."
sleep 1
echo "I am going to ask you a few questions, and as you answer them I will create your MUD."
sleep 1
echo "* MAKE SURE YOU HAVE WRITE PERMISSION TO mudUNIX.sh *"
sleep 1
echo "***** MAKE SURE YOU ARE EXECUTING THIS SCRIPT FROM THE MAIN COFFEEMUD DIR (not source dir)*****"
sleep 2
echo "Questions:"
echo "1. What is the location of JAVA V1.8+ (example: /opt/jdk1.8.0_09 - just to main dir NO TRAILING SLASH)?"
read Java_Home
echo "
2. Do you want to compile docs about the source code (not needed to run - javadoc etc.; more time consuming; you may need to be root...) ? [y/n]
"
read yesnodocs
echo "3. Do you want to compile the full program right now (say no if you're only doing the docs, or changing the name of your MUD)? [y/n]"
read yesnofullcompile
echo "4. What have you decided to name your MUD (you can change this later by editing the mudUNIX.sh file) ?"
read MUDname
echo "5. Do you want your passwords hashed? [y/n]"
read yesnohashpasswords
if [ $yesnohashpasswords = y ] ; then
sed -i 's/HASHPASSWORDS=NO/HASHPASSWORDS=YES/g' coffeemud.ini
fi
echo "Alright, we're good to go, compiling will begin in 5 seconds."
sleep 5
#Next we will set up some needed variables for compiling.... and then run an if statement
JAVACPATH="$Java_Home/bin/javac -nowarn -g -deprecation -encoding UTF8 -classpath .:./lib/js.jar:./lib/jzlib.jar"
if [ $yesnodocs = y ] ; then
echo "/nBeginning compile of the source docs...this may take awhile...you were warned!/n"
sleep 1
$Java_Home/bin/javadoc -d ./docs -J-Xmx256m -subpackages com.planet_ink.coffee_mud
else
echo "OK no doc compiling for you...well its mainly for source developers anyways..."
echo "About to begin main compile....."
sleep 1
fi
if [ $yesnofullcompile = y ] ; then
$JAVACPATH com/planet_ink/fakedb/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/*.java
$JAVACPATH com/planet_ink/coffee_mud/application/*.java
$JAVACPATH com/planet_ink/coffee_mud/Areas/*.java
$JAVACPATH com/planet_ink/coffee_mud/Behaviors/*.java
$JAVACPATH com/planet_ink/coffee_mud/CharClasses/*.java
$JAVACPATH com/planet_ink/coffee_mud/Commands/*.java
$JAVACPATH com/planet_ink/coffee_mud/Common/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/database/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/exceptions/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/cm1/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/cm1/commands/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/i3/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/i3/net/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/i3/packets/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/i3/persist/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/i3/server/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/intermud/imc2/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/smtp/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/threads/*.java
$JAVACPATH com/planet_ink/coffee_mud/core/collections/*.java
$JAVACPATH com/planet_ink/coffee_mud/Exits/*.java
$JAVACPATH com/planet_ink/coffee_mud/Libraries/*.java
$JAVACPATH com/planet_ink/coffee_mud/Locales/*.java
$JAVACPATH com/planet_ink/coffee_mud/MOBS/*.java
$JAVACPATH com/planet_ink/coffee_mud/Races/*.java
$JAVACPATH com/planet_ink/coffee_mud/WebMacros/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Archon/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Common/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Diseases/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Druid/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Fighter/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Languages/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Misc/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Paladin/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Poisons/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Prayers/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Properties/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Ranger/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Skills/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Songs/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Specializations/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Spells/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/SuperPowers/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Tech/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Thief/*.java
$JAVACPATH com/planet_ink/coffee_mud/Abilities/Traps/*.java
$JAVACPATH com/planet_ink/coffee_mud/Areas/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Behaviors/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/CharClasses/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Commands/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Common/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Exits/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/Armor/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/Basic/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/ClanItems/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/MiscMagic/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/BasicTech/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/CompTech/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/Software/*.java
$JAVACPATH com/planet_ink/coffee_mud/Items/Weapons/*.java
$JAVACPATH com/planet_ink/coffee_mud/Libraries/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Libraries/layouts/*.java
$JAVACPATH com/planet_ink/coffee_mud/Libraries/mcppkgs/*.java
$JAVACPATH com/planet_ink/coffee_mud/Locales/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/MOBS/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Races/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/WebMacros/grinder/*.java
$JAVACPATH com/planet_ink/coffee_mud/WebMacros/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Tests/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_mud/Tests/*.java
$JAVACPATH com/planet_ink/coffee_web/converters/*.java
$JAVACPATH com/planet_ink/coffee_web/http/*.java
$JAVACPATH com/planet_ink/coffee_web/interfaces/*.java
$JAVACPATH com/planet_ink/coffee_web/server/*.java
$JAVACPATH com/planet_ink/coffee_web/servlets/*.java
$JAVACPATH com/planet_ink/coffee_web/util/*.java
$JAVACPATH com/planet_ink/siplet/applet/*.java
$JAVACPATH com/planet_ink/siplet/support/*.java
else
echo "What!? No main compile for you...maybe you just wanted to compile the docs? Or change your MUD's name...any ways...I'll make this more intuitive in the future!"
fi
echo "Writing your new mudUNIX.sh..."
rm mudUNIX.sh
echo "#You should really input a name for your MUD below...." >> mudUNIX.sh
echo "#Before using this on a UNIX machine, you must 'chmod 755 mudUNIX.sh' to make this file executable by the UNIX machine" >> mudUNIX.sh
echo "#FYI - the nohup command will make a nohup.out file, usually in the CofferMud (directory where you start this from) directory - it will log the server messages..." >> mudUNIX.sh
echo "" >> mudUNIX.sh
echo "nohup $Java_Home/bin/java -classpath \".:./lib/js.jar:./lib/jzlib.jar\" -Xms129m -Xmx256m com.planet_ink.coffee_mud.application.MUD \"$MUDname\" &" >> mudUNIX.sh
chmod 755 mudUNIX.sh
echo "Your mudUNIX.sh script has been written."
echo "To change memory or other settings, you must MANUALLY edit mudUNIX.sh after every time you run this script."
echo "Would you like to start your mud up? [y/n]"
read startyeanay
if [ $startyeanay = y ] ; then
sleep 1
echo "OK your MUD is now starting..."
sh mudUNIX.sh
else
echo "Alright, MUD not starting now, if you wish to start it later just do sh mudUNIX.sh"
echo "Hope you enjoy CoffeeMud!"
fi