|
@@ -1,19 +1,32 @@
|
1
|
1
|
#!/bin/sh
|
2
|
2
|
cd `dirname $0`
|
3
|
|
-if [ ! -d "~/.OpenRaider" ]; then
|
|
3
|
+if [ ! -d "${HOME}/.OpenRaider" ]; then
|
4
|
4
|
echo "Setting up OpenRaider for user $USER..."
|
5
|
5
|
mkdir -p ~/.OpenRaider
|
6
|
6
|
cp ../Resources/defaults/OpenRaider.init ~/.OpenRaider/
|
7
|
7
|
cp ../Resources/defaults/custom.cfg ~/.OpenRaider/
|
8
|
|
- mkdir -p ~/.OpenRaider/paks/custom
|
|
8
|
+ mkdir -p ~/.OpenRaider/paks
|
9
|
9
|
mkdir -p ~/.OpenRaider/music
|
10
|
10
|
mkdir -p ~/.OpenRaider/data
|
11
|
11
|
mkdir -p ~/.OpenRaider/sshots
|
12
|
12
|
cp ../Resources/defaults/*.tga ~/.OpenRaider/data
|
13
|
13
|
cp ../Resources/defaults/*.wav ~/.OpenRaider/data
|
14
|
14
|
cp ../Resources/defaults/*.ttf ~/.OpenRaider/data
|
15
|
|
- cp ../Resources/defaults/*.tr2 ~/.OpenRaider/paks/custom
|
16
|
15
|
echo "DONE"
|
17
|
16
|
osascript -e 'tell app "System Events" to display alert "Initial Configuration stored in ~/.OpenRaider\n\nView and edit OpenRaider.init to your needs..."'
|
18
|
17
|
fi
|
19
|
|
-./OpenRaider-bin
|
|
18
|
+if [[ ! -n `find "${HOME}/.OpenRaider/paks" -type f -exec echo Found {} \;` ]]; then
|
|
19
|
+ echo "Missing level files!"
|
|
20
|
+ osascript -e 'tell app "System Events" to display alert "No level files stored in ~/.OpenRaider/paks\n\nPlace level files there and edit ~/.OpenRaider/OpenRaider.init"'
|
|
21
|
+else
|
|
22
|
+ if [[ ! `diff "${HOME}/.OpenRaider/OpenRaider.init" "../Resources/defaults/OpenRaider.init"` ]]; then
|
|
23
|
+ if [[ ! `diff "${HOME}/.OpenRaider/custom.cfg" "../Resources/defaults/custom.cfg"` ]]; then
|
|
24
|
+ echo "Unconfigured user!"
|
|
25
|
+ osascript -e 'tell app "System Events" to display alert "Please edit ~/.OpenRaider/OpenRaider.init or ~/.OpenRaider/custom.cfg"'
|
|
26
|
+ else
|
|
27
|
+ ./OpenRaider-bin
|
|
28
|
+ fi
|
|
29
|
+ else
|
|
30
|
+ ./OpenRaider-bin
|
|
31
|
+ fi
|
|
32
|
+fi
|