summaryrefslogtreecommitdiff
path: root/community/mldonkey/mldonkey.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/mldonkey/mldonkey.install')
-rw-r--r--community/mldonkey/mldonkey.install27
1 files changed, 27 insertions, 0 deletions
diff --git a/community/mldonkey/mldonkey.install b/community/mldonkey/mldonkey.install
new file mode 100644
index 000000000..68186f0be
--- /dev/null
+++ b/community/mldonkey/mldonkey.install
@@ -0,0 +1,27 @@
+post_install() {
+ if ! getent group mldonkey >/dev/null; then
+ groupadd --system mldonkey
+ fi
+ if ! getent passwd mldonkey >/dev/null; then
+ useradd --system -c 'Mldonkey daemon user' -g mldonkey -d /var/lib/mldonkey -s /bin/false mldonkey
+ fi
+
+ mkdir -p /var/lib/mldonkey
+ chown mldonkey:mldonkey /var/lib/mldonkey
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ if getent passwd mldonkey >/dev/null; then
+ userdel mldonkey
+ fi
+ if getent group mldonkey >/dev/null; then
+ groupdel mldonkey
+ fi
+
+ update-desktop-database -q
+}