aboutsummaryrefslogtreecommitdiffstats
path: root/spigot/spigot.install
diff options
context:
space:
mode:
Diffstat (limited to 'spigot/spigot.install')
-rw-r--r--spigot/spigot.install21
1 files changed, 21 insertions, 0 deletions
diff --git a/spigot/spigot.install b/spigot/spigot.install
new file mode 100644
index 0000000..20067d1
--- /dev/null
+++ b/spigot/spigot.install
@@ -0,0 +1,21 @@
+post_install() {
+ getent group craftbukkit >/dev/null 2>&1 || groupadd craftbukkit
+ getent passwd craftbukkit >/dev/null 2>&1 || useradd -g craftbukkit -d /srv/craftbukkit -s /bin/bash craftbukkit
+ chown -R craftbukkit:craftbukkit /srv/craftbukkit/
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ if getent passwd craftbukkit >/dev/null 2>&1; then
+ userdel craftbukkit
+ fi
+ if getent group craftbukkit >/dev/null 2>&1; then
+ groupdel craftbukkit
+ fi
+
+ echo "There are probably still files in /srv/craftbukkit, you must remove those manually!" >&2
+}
+