post_install() {
  echo "================================================================"
  echo "ocserv-allinone has been installed. Complete these steps first:"
  echo "  1. Review /etc/ocserv/ocserv.conf (RADIUS, domain and VPN pool)."
  echo "  2. For certificate login, initialize the client CA once:"
  echo "     /etc/ocserv/client/init-certificate.sh -d vpn.example.com"
  echo "  3. Review /usr/bin/ocserv-iptables-init before running it."
  echo "     It flushes existing iptables rules; keep the active SSH port open."
  echo "     It also saves the rules and enables iptables.service at boot."
  echo "     /usr/bin/ocserv-iptables-init"
  echo "  4. Validate the configuration, then enable the service:"
  echo "     ocserv --test-config -c /etc/ocserv/ocserv.conf"
  echo "     systemctl enable --now ocserv"
  echo ""
  echo "Useful commands:"
  echo "  systemctl status ocserv"
  echo "  journalctl -u ocserv -e"
  echo "  occtl show users"
  echo "  /etc/ocserv/client/generate-certificate.sh -u USER -g GROUP -p PASSWORD"
  echo "  ocpasswd -c /etc/ocserv/passwd -g GROUP USER  # plain auth only"
  echo "================================================================"
}

post_upgrade() {
  echo "================================================================"
  echo "ocserv-allinone has been upgraded. Existing configuration is kept."
  echo "Files under config-per-user/ and config-per-group/ are preserved."
  echo "Check for .pacnew files under /etc/ocserv and /usr/bin, then run:"
  echo "  ocserv --test-config -c /etc/ocserv/ocserv.conf"
  echo "  systemctl restart ocserv"
  echo "  systemctl status ocserv"
  echo "  journalctl -u ocserv -e"
  echo "================================================================"
}

post_remove() {
  echo "================================================================"
  echo "ocserv-allinone has been removed."
  echo "Configuration backups may remain under /etc/ocserv as .pacsave files."
  echo "Review and remove them manually if they are no longer needed."
  echo "================================================================"
}
