upgpkg: minecraft-server 1.11.2-4

Do not remove the user upon un-installation and do not stop the server
prior to removal in order to conform with the Arch package standards.
This commit is contained in:
Gordian Edenhofer 2017-04-13 14:18:17 +02:00
parent d13086f4da
commit 5a97b7c725
3 changed files with 4 additions and 20 deletions

View File

@ -1,7 +1,7 @@
pkgbase = minecraft-server pkgbase = minecraft-server
pkgdesc = Minecraft server unit files, script, and jar pkgdesc = Minecraft server unit files, script, and jar
pkgver = 1.11.2 pkgver = 1.11.2
pkgrel = 3 pkgrel = 4
url = https://minecraft.net/ url = https://minecraft.net/
install = minecraft-server.install install = minecraft-server.install
arch = any arch = any

View File

@ -4,7 +4,7 @@
pkgname=minecraft-server pkgname=minecraft-server
pkgver=1.11.2 pkgver=1.11.2
pkgrel=3 pkgrel=4
pkgdesc="Minecraft server unit files, script, and jar" pkgdesc="Minecraft server unit files, script, and jar"
arch=('any') arch=('any')
url="https://minecraft.net/" url="https://minecraft.net/"

View File

@ -29,24 +29,8 @@ post_upgrade() {
chown -R ${_user}:${_user} "${_server_root}" chown -R ${_user}:${_user} "${_server_root}"
} }
pre_remove() {
echo -e "\e[34;1m==>\e[39;1m Stopping and disabling ${_game}d... \e[0m"
systemctl stop ${_game}d.service
systemctl disable ${_game}d.service
/usr/bin/${_game}d stop > /dev/null
}
post_remove() { post_remove() {
# Notifying the user of kept dirs # Notifying the user of kept dirs
[[ -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" [[ -d "${_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/${_game}" ]] && echo -e "\e[34;1m==>\e[39;1m NOTE: Your configuration file /etc/conf.d/${_game} was kept on your system.\e[0m" echo -e "\e[34;1m==>\e[39;1m NOTE: The ${_user} user was preserved on your system. \e[0m"
echo -e "\e[34;1m==>\e[39;1m Removing ${_user} system user and group... \e[0m"
if getent passwd ${_user} >/dev/null 2>&1; then
userdel ${_user} 2>/dev/null
fi
if getent group ${_user} >/dev/null 2>&1; then
groupdel ${_user}
fi
} }