post_install() {
  getent group chrony &>/dev/null || groupadd -g 183 chrony >/dev/null
  getent passwd chrony &>/dev/null || useradd -u 183 -g chrony -d /var/lib/chrony -c 'Network Time Protocol' -s /bin/false chrony >/dev/null
}

post_upgrade() {
  if [[ $(vercmp $2 1.29.1-2) -le 0 ]]; then
    getent group chrony &>/dev/null || groupadd -r -g 183 chrony >/dev/null
    getent passwd chrony &>/dev/null || useradd -r -u 183 -g chrony -d /var/lib/chrony -c 'Network Time Protocol' -s /bin/false chrony >/dev/null
    chown -R 183:183 /var/lib/chrony
  fi
}
