diff options
author | Gordian Edenhofer | 2016-01-23 12:45:46 +0100 |
---|---|---|
committer | Gordian Edenhofer | 2016-01-23 12:45:46 +0100 |
commit | b94e3db3db0e96c489bc4a40fc7c8c75246cb56e (patch) | |
tree | 35dce12565a257d98ed11663cd99b9b8cbcfddb6 /minecraft-server.install | |
parent | fc5a4e085db0beb6978e43ea8ef1a7daaecefa37 (diff) | |
download | aur-b94e3db3db0e96c489bc4a40fc7c8c75246cb56e.tar.gz |
Upgpkg: 1.8.9-2
Restore backups easily with the delivered bash script
Human readable naming schema for backups
Backed up directories are now relative
Group has write permission (g+ws) to SERVER_ROOT
Proper quotation of variables which might contain spaces
Diffstat (limited to 'minecraft-server.install')
-rw-r--r-- | minecraft-server.install | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/minecraft-server.install b/minecraft-server.install index 5b528c8a73cb..fc4635c71153 100644 --- a/minecraft-server.install +++ b/minecraft-server.install @@ -1,7 +1,7 @@ USER="minecraft" SERVER_ROOT="/srv/minecraft" -_update() { +post_install() { getent group "${USER}" &>/dev/null if [ $? -ne 0 ]; then echo -e "\e[34;1m==>\e[39;1m Adding ${USER} system group... \e[0m" @@ -24,12 +24,13 @@ _update() { echo -e "\e[34;1m==>\e[39;1m which is generated after the first server start. \e[0m" } -post_install() { - _update -} - post_upgrade() { - _update + chown -R ${USER}:${USER} "${SERVER_ROOT}" + + if [[ -f /etc/conf.d/minecraft.pacnew ]]; then + echo -e "\e[34;1m==>\e[39;1m NOTE: There was a new change on how backup files are handled! Please merge the new \e[0m" + echo -e "\e[34;1m==>\e[39;1m configuration file into /etc/conf.d/minecraft by e.g. pacdiff. \e[0m" + fi } pre_remove() { @@ -50,6 +51,6 @@ post_remove() { fi # Notifying the user of kept dirs - [ -d ${SERVER_ROOT} ] && chown root:root ${SERVER_ROOT} && echo -e "\e[34;1m==>\e[39;1m NOTE: Game saves in ${SERVER_ROOT} were kept on your system.\e[0m" - [ -d /etc/conf.d/minecraft ] && echo -e "\e[34;1m==>\e[39;1m NOTE: Your configuration file /etc/conf.d/minecraft was kept on your system.\e[0m" + [[ -d "${SERVER_ROOT}" ]] && chown -R root:root "${SERVER_ROOT}" && echo -e "\e[34;1m==>\e[39;1m NOTE: Game saves in ${SERVER_ROOT} were kept on your system.\e[0m" + [[ -f "/etc/conf.d/minecraft" ]] && echo -e "\e[34;1m==>\e[39;1m NOTE: Your configuration file /etc/conf.d/minecraft was kept on your system.\e[0m" } |