Compare commits

...

2 commits

2 changed files with 8 additions and 3 deletions

View file

@ -1,6 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# required for the complex pipes in the machine function
shopt -s lastpipe
install_dir="$(dirname "$(readlink -f "$0")")" # find the install directory install_dir="$(dirname "$(readlink -f "$0")")" # find the install directory
source "$install_dir/functions.sh" source "$install_dir/functions.sh"
@ -20,7 +18,6 @@ else
echo "Firewall rule already exists" echo "Firewall rule already exists"
fi fi
latest=`curl -s https://api.papermc.io/v2/projects/paper/ | jq -r .versions[-1]`
versionprompt versionprompt
echo -n "Waiting for machine to respond" echo -n "Waiting for machine to respond"
# send pings every second, waiting for 1 second # send pings every second, waiting for 1 second

View file

@ -1,3 +1,6 @@
# required for the complex pipes
shopt -s lastpipe
config() { config() {
local command="$1"; shift local command="$1"; shift
@ -232,7 +235,12 @@ machine(){
esac esac
} }
versionprompt() { versionprompt() {
if [ -z ${latest+x} ]; then
latest=`curl -s https://api.papermc.io/v2/projects/paper/ | jq -r .versions[-1]`
fi
# ask the user which version of minecraft they would like to install # ask the user which version of minecraft they would like to install
echo "Which version of minecraft would you like to serve?" echo "Which version of minecraft would you like to serve?"
echo -n "Version [$latest]:" echo -n "Version [$latest]:"