summaryrefslogtreecommitdiff
path: root/community/mldonkey/mldonkey.install
blob: 58ae4934cbd7cc4beaa28d31bb7361103ad386bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
  type -P update-desktop-database >/dev/null && 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

  type -P update-desktop-database >/dev/null && update-desktop-database -q
}