File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -eo pipefail
4
4
5
+ : " ${TMP_DIR:=/ data/ tmp} "
6
+
5
7
if [[ ${DEBUG^^} = TRUE ]]; then
6
8
set -x
7
9
curlArgs=(-v)
8
10
echo " DEBUG: running as $( id -a) with $( ls -ld /data) "
11
+ echo " current directory is $( pwd) "
9
12
fi
10
13
11
14
downloadPage=https://www.minecraft.net/en-us/download/server/bedrock
@@ -84,7 +87,8 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
84
87
DOWNLOAD_URL=https://minecraft.azureedge.net/bin-linux/bedrock-server-${VERSION} .zip
85
88
fi
86
89
87
- TMP_ZIP=/tmp/$( basename " ${DOWNLOAD_URL} " )
90
+ [[ $TMP_DIR != /tmp ]] && mkdir -p " $TMP_DIR "
91
+ TMP_ZIP=" $TMP_DIR /$( basename " ${DOWNLOAD_URL} " ) "
88
92
89
93
echo " Downloading Bedrock server version ${VERSION} ..."
90
94
if ! curl " ${curlArgs[@]} " -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL} ; then
@@ -120,7 +124,7 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
120
124
# Do not overwrite existing files, which means the cleanup above needs to account for things
121
125
# that MUST be replaced on upgrade
122
126
unzip -q -n ${TMP_ZIP}
123
- rm ${TMP_ZIP}
127
+ [[ $TMP_DIR != /tmp ]] && rm -rf " $TMP_DIR "
124
128
125
129
chmod +x bedrock_server
126
130
mv bedrock_server bedrock_server-${VERSION}
You can’t perform that action at this time.
0 commit comments