Update script

This commit is contained in:
Timo Ley 2020-07-29 23:34:44 +02:00 committed by GitHub
parent 9bde193aa5
commit 1d4437baa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

20
mpt
View file

@ -9,33 +9,35 @@ install)
then
dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest)
echo Downloading $dl ...
curl $dl --output $HOME/.mpt/mpt.jar
curl "$dl --output $HOME/.mpt/mpt.jar"
fi
;;
update)
dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest)
echo Downloading $dl ...
if [ -f "$HOME/.mpt/mpt.jar" ]
if [ -f ".mpt/mpt.jar" ]
then
curl $dl --output $HOME/.mpt/mpt.jar
curl "$dl --output .mpt/mpt.jar"
else
curl $dl --output .mpt/mpt.jar
curl "$dl --output $HOME/.mpt/mpt.jar"
fi
echo Updating Script
curl https://data.tilera.xyz/file/mpt/mpt > mpt
;;
*)
if ! [ -d ".mpt" ];
then mkdir .mpt
fi
if [ -f "$HOME/.mpt/mpt.jar" ];
then jar=$HOME/.mpt/mpt.jar
elif [ -f ".mpt/mpt.jar" ];
if [ -f ".mpt/mpt.jar" ];
then jar=.mpt/mpt.jar
elif [ -f "$HOME.mpt/mpt.jar" ];
then jar=$HOME.mpt/mpt.jar
else
dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest)
echo Downloading $dl ...
curl $dl --output .mpt/mpt.jar
curl "$dl --output .mpt/mpt.jar"
jar=.mpt/mpt.jar
fi
java -jar $jar $*
;;
esac
esac