summarylogtreecommitdiffstats
path: root/owntone.install
blob: 17e5f357f6ade62a545046ce726bdc2bc8b29d53 (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
28
29
30
post_install() {
  mkdir -p /var/lib/owntone
  getent group owntone &>/dev/null || groupadd -r owntone >/dev/null
  getent passwd owntone &>/dev/null || useradd -r -g owntone -d /var/lib/owntone -s /bin/false -c owntone owntone >/dev/null
  mkdir -p $pkgdir/var/cache/owntone
  chown owntone:owntone $pkgdir/var/cache/owntone

  cat <<EOF
==> owntone can be started via systemctl:
==> systemctl start owntone

==> owntone can be autostart via systemctl:
==> systemctl enable owntone

==> owntone.service has been added to your /etc/avahi/services

==> Please edit /etc/owntone.conf to suit your needs
==> (point it to your music library)
EOF
}

pre_remove() {
  systemctl stop owntone || true
  systemctl disable owntone || true
}

post_remove() {
  getent passwd owntone &>/dev/null && userdel owntone >/dev/null
  getent group owntone &>/dev/null && groupdel owntone >/dev/null
}