mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-26 12:16:25 +01:00
34 lines
742 B
Bash
34 lines
742 B
Bash
|
# SubCreator Paper Build Script
|
||
|
#
|
||
|
#!/usr/bin/env bash
|
||
|
if [[ -z "$version" ]]
|
||
|
then
|
||
|
echo ERROR: No Build Version Supplied
|
||
|
rm -Rf "$0"
|
||
|
exit 1
|
||
|
fi
|
||
|
function __DL() {
|
||
|
if [[ -x "$(command -v wget)" ]]; then
|
||
|
wget -O "$1" "$2"; return $?
|
||
|
else
|
||
|
curl -o "$1" "$2"; return $?
|
||
|
fi
|
||
|
}
|
||
|
echo Downloading Paper...
|
||
|
if [[ -f "Paper.jar" ]]; then
|
||
|
if [[ -f "Paper.old.jar.x" ]]; then
|
||
|
rm -Rf Paper.old.jar.x
|
||
|
fi
|
||
|
mv Paper.jar Paper.old.jar.x
|
||
|
fi
|
||
|
__DL Paper.jar "https://papermc.io/api/v1/paper/$version/latest/download"; __RETURN=$?
|
||
|
if [[ $__RETURN -eq 0 ]]; then
|
||
|
echo Cleaning Up...
|
||
|
rm -Rf "$0"
|
||
|
exit 0
|
||
|
else
|
||
|
echo ERROR: Failed downloading Paper. Is PaperMC.io down?
|
||
|
rm -Rf "$0"
|
||
|
exit 3
|
||
|
fi
|
||
|
exit 2
|