summarylogtreecommitdiffstats
path: root/readme.install
blob: c9b62f833cd360e5fb3d14680ca8f797e1050e8e (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
post_install() {
  getent group kodi > /dev/null || groupadd -g 420 kodi
  if ! getent passwd kodi > /dev/null; then
    useradd -c 'kodi user' -u 420 -g kodi -G audio,network,optical,uucp,video \
      -d /var/lib/kodi -s /usr/bin/nologin kodi
    passwd -l kodi > /dev/null
    [[ ! -d /var/lib/kodi/.kodi ]] &&
      mkdir /var/lib/kodi/.kodi &&
      chown -R kodi:kodi /var/lib/kodi/.kodi
  fi
}

post_upgrade() {
  usermod -g kodi -aG audio,network,optical,uucp,video kodi
}

post_remove() {
  echo "==> Optionally delete the kodi user and its home directory"
  echo "==>   if you are certain no processes are running under it."
  echo "==>   userdel kodi"
  echo "==>   groupdel kodi"
  echo "==>   rm -rf /var/lib/kodi"
}

# vim:set ts=2 sw=2 et: