git.slaskete.net
/
einar-bin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5028e1e
)
La til noen sikkerhetsrelaterte sjekker i minecraft.sh
author
Einar Jørgen Haraldseid
<einar@haraldseid.net>
Thu, 2 Aug 2012 13:28:06 +0000
(15:28 +0200)
committer
Einar Jørgen Haraldseid
<einar@haraldseid.net>
Thu, 2 Aug 2012 13:28:06 +0000
(15:28 +0200)
minecraft.sh
patch
|
blob
|
history
diff --git
a/minecraft.sh
b/minecraft.sh
index 70b1bf6f5ad290ef64924f0baa71388985796cf1..93cdbdc44d197e58fdce63d1d13b2b943c846177 100755
(executable)
--- a/
minecraft.sh
+++ b/
minecraft.sh
@@
-18,8
+18,11
@@
# Released to the public under the WTFPL: http://sam.zoy.org/wtfpl/COPYING
# CONFIG STUFF - change these to suit your system
# Released to the public under the WTFPL: http://sam.zoy.org/wtfpl/COPYING
# CONFIG STUFF - change these to suit your system
+# Minecraft home folder, where the binaries and saves and stuff are stored:
MC_HOME="${HOME}/.minecraft"
MC_HOME="${HOME}/.minecraft"
+# Location and filename for the Minecraft launcher jar:
MC_LAUNCHER="${HOME}/bin/minecraft.jar"
MC_LAUNCHER="${HOME}/bin/minecraft.jar"
+# Command line to run to start Minecraft:
MC_COMMAND="java -Xmx2048M -Xms1024M -cp ${MC_LAUNCHER} net.minecraft.LauncherFrame"
# This might be needed to fix 64bit java on Linux (path to your 64bit java libs)
MC_COMMAND="java -Xmx2048M -Xms1024M -cp ${MC_LAUNCHER} net.minecraft.LauncherFrame"
# This might be needed to fix 64bit java on Linux (path to your 64bit java libs)
@@
-34,18
+37,28
@@
if [ ${#} -ne 1 ]; then
exit 1
fi
exit 1
fi
+if [ -z ${MC_HOME} ]; then
+ echo "Minecraft home folder not set! Baaaad idea!"
+ exit 1
+fi
+
+if [ ! -d ${MC_HOME} ]; then
+ echo "Minecraft home folder (${MC_HOME}) not found!"
+ exit 1
+fi
+
MC_VERSION_FOLDER="${MC_HOME}/bin-${1}"
MC_WORKING_FOLDER="${MC_HOME}/bin"
if [ ! -d "${MC_VERSION_FOLDER}" ]; then
MC_VERSION_FOLDER="${MC_HOME}/bin-${1}"
MC_WORKING_FOLDER="${MC_HOME}/bin"
if [ ! -d "${MC_VERSION_FOLDER}" ]; then
- echo "Could not find that version folder."
+ echo "Could not find that version folder
(${MC_WORKING_FOLDER})
."
exit 1
fi
if [ -d "${MC_WORKING_FOLDER}" ]; then
rm -rf ${MC_WORKING_FOLDER}
elif [ ! -d "${MC_WORKING_FOLDER}" ]; then
exit 1
fi
if [ -d "${MC_WORKING_FOLDER}" ]; then
rm -rf ${MC_WORKING_FOLDER}
elif [ ! -d "${MC_WORKING_FOLDER}" ]; then
- echo "Minecraft bin folder is not a directory, bailing out."
+ echo "Minecraft bin folder
(${MC_WORKING_FOLDER})
is not a directory, bailing out."
exit 1
fi
exit 1
fi