Compare commits
2 Commits
f11d06dc08
...
a0981f0c81
| Author | SHA1 | Date | |
|---|---|---|---|
| a0981f0c81 | |||
| 4720f63667 |
19
server-properties/helpers/curl.sh
Normal file
19
server-properties/helpers/curl.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
function __curl() {
|
||||||
|
read -r proto server path <<<"$(printf '%s' "${1//// }")"
|
||||||
|
if [ "$proto" != "http:" ]; then
|
||||||
|
printf >&2 "sorry, %s supports only http\n" "${FUNCNAME[0]}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
DOC=/${path// //}
|
||||||
|
HOST=${server//:*}
|
||||||
|
PORT=${server//*:}
|
||||||
|
[ "${HOST}" = "${PORT}" ] && PORT=80
|
||||||
|
|
||||||
|
exec 3<>"/dev/tcp/${HOST}/$PORT"
|
||||||
|
printf 'GET %s HTTP/1.0\r\nHost: %s\r\n\r\n' "${DOC}" "${HOST}" >&3
|
||||||
|
(while read -r line; do
|
||||||
|
[ "$line" = $'\r' ] && break
|
||||||
|
done && cat) <&3
|
||||||
|
exec 3>&-
|
||||||
|
}
|
||||||
|
|
||||||
@ -78,6 +78,24 @@ fi
|
|||||||
git pull
|
git pull
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Import dev-tools
|
||||||
|
#
|
||||||
|
if [[ "$ENV" = "dev" || "stag" ]]; then
|
||||||
|
echo
|
||||||
|
echo "checking devtools..."
|
||||||
|
(
|
||||||
|
source ./config/server-properties/helpers/curl.sh
|
||||||
|
cd ./world/datapacks
|
||||||
|
if [[ ! -f benchmark-v2-1-0.zip ]]; then
|
||||||
|
"missing Benchmark v2, downloading..."
|
||||||
|
__curl "https://files.ferdin.land/ferdinland/devtools/benchmark-v2-1-0.zip" > benchmark-v2-1-0.zip
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
echo "devltools all good!"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copy server-properties
|
# Copy server-properties
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user