Compare commits

..

No commits in common. "bf90abfc2d08998b44a8c24852243e87ab1275a1" and "65ea59f48525cadddfef2c16c90136be30dd3097" have entirely different histories.

3 changed files with 7 additions and 17 deletions

View file

@ -59,12 +59,10 @@ if [ -e /server.tar.zstd ]; then
tar -C / --zstd --overwrite -x -f /server.tar.zstd
fi
if [ $VERSION ]; then
# find the latest release of the requested version and download it
echo "downloading minecraft $VERSION..."
RELEASE=`curl -s https://api.papermc.io/v2/projects/paper/versions/$VERSION/ | jq -r .builds[-1]`
curl https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$RELEASE/downloads/paper-$VERSION-$RELEASE.jar -o /srv/minecraft/server/paperclip.jar
fi
# find the latest release of the requested version and download it
echo "downloading minecraft $VERSION..."
RELEASE=`curl -s https://api.papermc.io/v2/projects/paper/versions/$VERSION/ | jq -r .builds[-1]`
curl https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$RELEASE/downloads/paper-$VERSION-$RELEASE.jar -o /srv/minecraft/server/paperclip.jar
mkdir /home/mc/.ssh
cp /root/.ssh/authorized_keys /home/mc/.ssh/authorized_keys

View file

@ -8,7 +8,6 @@ reigon="sfo3"
config get
data_dir get
keys check
machine create
machine show ipv4 | jq -r .ip_address | read ipv4_address
@ -25,15 +24,7 @@ if [ $DOMAIN ]; then
domain A create
fi
if [ -f "$data_dir/server.tar.zstd" ]; then
echo "Would you like to install a new server jar?"
if yes; then
versionprompt
fi
else
versionprompt
fi
versionprompt
echo -n "Waiting for machine to respond"
# tests if ssh is up, waiting one second between attempts
until nc $ipv4_address 22 <<<'' 2> /dev/null | grep -q 'SSH'; do
@ -42,6 +33,7 @@ until nc $ipv4_address 22 <<<'' 2> /dev/null | grep -q 'SSH'; do
done
echo
data_dir get
if [ -f "$data_dir/server.tar.zstd" ]; then
echo "Uploading server backup..."

View file

@ -7,6 +7,6 @@ config get
machine show ipv4 | jq -r .ip_address | read ipv4_address
ssh root@$ipv4_address <<<mc-backup > "$data_dir/server.tar.zstd"
if [ $DOMAIN ]; then
domain A delete
domain A destroy
fi
machine destroy