Created
October 22, 2017 19:37
-
-
Save mcwnuq/79e79caba173b66402bc27cdb8e090a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
screen -dmS mcwnuq java -server -Xmx2G -jar mcwnuq-*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#lastSuccessfulBuild=`curl -s 'https://ci.destroystokyo.com/job/PaperSpigot/api/json' | jq '.lastSuccessfulBuild.number'` | |
NAME="mcwnuq" | |
filename="$NAME-*.jar" | |
lastSuccessfulBuild=`curl -s https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/buildNumber` | |
echo "najnowsza wersja to: $lastSuccessfulBuild" | |
if [ -f $filename ] | |
then | |
version=`ls $filename | cut -d "-" -f 2 | cut -d "." -f 1` | |
echo "twoja wersja to: $version" | |
if [ "$version" -eq "$lastSuccessfulBuild" ] | |
then | |
echo "masz najnowsza wersje" | |
else | |
echo "nie masz najnowszej wersji" | |
behind=`expr $lastSuccessfulBuild - $version` | |
echo "jestes $behind wersji wstecz" | |
echo "usuwam stary silnik..." | |
rm $filename | |
echo "pobieram nowy silnik..." | |
wget -q https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/artifact/paperclip-$lastSuccessfulBuild.jar | |
echo "zmieniam jego nazwe..." | |
mv "paperclip-$lastSuccessfulBuild.jar" "$NAME-$lastSuccessfulBuild.jar" | |
fi | |
else | |
echo "pobieram nowy silnik..." | |
wget -q https://ci.destroystokyo.com/job/PaperSpigot/lastSuccessfulBuild/artifact/paperclip-$lastSuccessfulBuild.jar | |
echo "zmieniam jego nazwe..." | |
mv "paperclip-$lastSuccessfulBuild.jar" "$NAME-$lastSuccessfulBuild.jar" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment