Skip to content

Instantly share code, notes, and snippets.

@kerryhatcher
Last active June 10, 2020 19:43
Show Gist options
  • Save kerryhatcher/eec1beb2f0bb57a1ea2347e4dc0ca641 to your computer and use it in GitHub Desktop.
Save kerryhatcher/eec1beb2f0bb57a1ea2347e4dc0ca641 to your computer and use it in GitHub Desktop.
swap out minecraft whitelists and restart server
#!/usr/bin/env bash
export fileappend=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
export oldfile=$(ls /opt/minecraft/whitelist.json-*)
mv /opt/minecraft/whitelist.json /opt/minecraft/whitelist.json-$fileappend
mv $oldfile /opt/minecraft/whitelist.json
cat /opt/minecraft/whitelist.json
chown -R craft:craft /opt/minecraft
systemctl restart minecraft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment