From 19b2a90b2ec13b7685ce6d45752ac584a0c76284 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Wed, 29 Jul 2020 17:44:30 +0200 Subject: [PATCH] add mpt script --- mpt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 mpt diff --git a/mpt b/mpt new file mode 100644 index 0000000..c2f6ee6 --- /dev/null +++ b/mpt @@ -0,0 +1,31 @@ +#!/bin/sh +cd "$(dirname "$0")" +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 ... + curl $dl --output $HOME/.mpt/mpt.jar + fi + ;; +*) + if ! [ -d ".mpt" ]; + then mkdir .mpt + fi + if [ -f "$HOME/.mpt/mpt.jar" ]; + then jar=$HOME/.mpt/mpt.jar + elif [ -f ".mpt/mpt.jar" ]; + then jar=.mpt/mpt.jar + else + dl=$(curl https://data.tilera.xyz/file/mpt/mpt-latest) + echo Downloading $dl ... + curl $dl --output .mpt/mpt.jar + jar=.mpt/mpt.jar + fi + java -jar $jar $* + ;; +esac \ No newline at end of file