-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpt
43 lines (43 loc) · 942 Bytes
/
mpt
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
#!/bin/sh
cd "$(dirname "$0")" || exit
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/api/mpt.php/latest)
echo Downloading $dl ...
curl $dl --output $HOME/.mpt/mpt.jar
fi
;;
update)
dl=$(curl https://data.tilera.xyz/api/mpt.php/latest)
echo Downloading $dl ...
if [ -f ".mpt/mpt.jar" ]
then
curl $dl --output .mpt/mpt.jar
else
curl $dl --output $HOME/.mpt/mpt.jar
fi
echo Updating Script
curl https://data.tilera.xyz/api/mpt.php/script > mpt
;;
*)
if ! [ -d ".mpt" ];
then mkdir .mpt
fi
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/api/mpt.php/latest)
echo Downloading $dl ...
curl $dl --output .mpt/mpt.jar
jar=.mpt/mpt.jar
fi
java -jar $jar $*
;;
esac