37 lines
993 B
Bash
37 lines
993 B
Bash
#!/usr/bin/env bash
|
|
|
|
PING_URL=$1
|
|
|
|
set -ex
|
|
|
|
cd /root
|
|
|
|
TARGET="@a"
|
|
|
|
docker exec mc mc-send-to-console title $TARGET title '\"Server restarting in \\u00A7c1 minute\"'
|
|
docker exec mc mc-send-to-console title $TARGET actionbar '\"This is so backups can be performed\"'
|
|
|
|
sleep 30
|
|
|
|
docker exec mc mc-send-to-console title $TARGET title '\"Server restarting in \\u00A7c30 seconds\"'
|
|
docker exec mc mc-send-to-console title $TARGET actionbar '\"This is so backups can be performed\"'
|
|
|
|
sleep 30
|
|
|
|
docker exec mc mc-send-to-console title $TARGET title '\"\\u00A7cRestarting...\"'
|
|
|
|
curl -m 10 --retry 5 "$PING_URL/start"
|
|
|
|
docker exec mc mc-send-to-console kick $TARGET '\"Server restarting for backups - please check back shortly.\"'
|
|
|
|
docker stop mc
|
|
|
|
OUTPUT_FILE="backup.tar.gz"
|
|
tar czf $OUTPUT_FILE data/whitelist.json data/ops.json data/server.properties data/lgbtqeaster/
|
|
|
|
docker start mc
|
|
|
|
./rclone copy $OUTPUT_FILE backblazebackups:akp-backups/lgbtq-mc
|
|
rm $OUTPUT_FILE
|
|
|
|
curl -m 10 --retry 5 $PING_URL
|