Mobs-Dimensions2/mpt

44 lines
948 B
Text
Raw Normal View History

2020-07-29 17:44:30 +02:00
#!/bin/sh
2020-07-29 18:05:27 +02:00
cd "$(dirname "$0")" || exit
2020-07-29 17:44:30 +02:00
case $1 in
install)
if ! [ -d "$HOME/.mpt" ];
then mkdir $HOME/.mpt
fi
if ! [ -f "$HOME/.mpt/mpt.jar" ];
then
dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest)
echo Downloading $dl ...
2020-07-29 23:34:44 +02:00
curl "$dl --output $HOME/.mpt/mpt.jar"
2020-07-29 17:44:30 +02:00
fi
;;
2020-07-29 18:05:27 +02:00
update)
dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest)
echo Downloading $dl ...
2020-07-29 23:34:44 +02:00
if [ -f ".mpt/mpt.jar" ]
2020-07-29 18:05:27 +02:00
then
2020-07-29 23:34:44 +02:00
curl "$dl --output .mpt/mpt.jar"
2020-07-29 18:05:27 +02:00
else
2020-07-29 23:34:44 +02:00
curl "$dl --output $HOME/.mpt/mpt.jar"
2020-07-29 18:05:27 +02:00
fi
2020-07-29 23:34:44 +02:00
echo Updating Script
curl https://data.tilera.xyz/file/mpt/mpt > mpt
2020-07-29 18:05:27 +02:00
;;
2020-07-29 17:44:30 +02:00
*)
if ! [ -d ".mpt" ];
then mkdir .mpt
fi
2020-07-29 23:34:44 +02:00
if [ -f ".mpt/mpt.jar" ];
2020-07-29 17:44:30 +02:00
then jar=.mpt/mpt.jar
2020-07-29 23:34:44 +02:00
elif [ -f "$HOME.mpt/mpt.jar" ];
then jar=$HOME.mpt/mpt.jar
2020-07-29 17:44:30 +02:00
else
dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest)
echo Downloading $dl ...
2020-07-29 23:34:44 +02:00
curl "$dl --output .mpt/mpt.jar"
2020-07-29 17:44:30 +02:00
jar=.mpt/mpt.jar
fi
java -jar $jar $*
;;
2020-07-29 23:34:44 +02:00
esac