forked from itzg/docker-minecraft-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-finalSetup01World
53 lines (49 loc) · 1.42 KB
/
start-finalSetup01World
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
#!/bin/bash
. /start-utils
if [ $TYPE = "FEED-THE-BEAST" ]; then
worldDest=$FTB_BASE_DIR/$LEVEL
else
worldDest=/data/$LEVEL
fi
# If no world exists and a URL for a world is supplied, download it and unpack
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
case "X$WORLD" in
X[Hh][Tt][Tt][Pp]*)
log "Downloading world from $WORLD"
curl -sSL -o - "$WORLD" > /data/world.zip
log "Unzipping world"
unzip -o -q /data/world.zip
rm -f /data/world.zip
if [ ! -d $worldDest ]; then
log World directory not found
for i in /data/*/level.dat; do
if [ -f "$i" ]; then
d=`dirname "$i"`
log Renaming world directory from $d
mv -f "$d" $worldDest
fi
done
fi
if [ "$TYPE" = "SPIGOT" ]; then
# Reorganise if a Spigot server
log "Moving End and Nether maps to Spigot location"
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
fi
;;
*)
if [[ -d "$WORLD" ]]; then
if [[ ! -d "$worldDest" ]]; then
log "Cloning world directory from $WORLD ..."
cp -r "$WORLD" "$worldDest"
else
log "Skipping clone from $WORLD since $worldDest exists"
fi
else
log "World cloning source '$WORLD' doesn't seem to exist"
exit 1
fi
;;
esac
fi
exec /start-finalSetup02Modpack $@