post_install() {
  local config_file="cjdroute.conf"
  local config_path="/etc/${config_file}"

  if [[ ! -e "${config_path}" ]] ; then
    echo "Generating ${config_file}... "
    (umask 077 && cjdroute --genconf > "${config_path}") || 
      echo "ERROR: Failed to generate and install ${config_file}"
    echo "
    >>> The keys in ${config_path} have been autogenerated during
    >>> install, they are not defaults and do not need to be overwritten."
  fi
  echo "
    >>> Protect ${config_path}! A lost conf file means you have
    >>> lost your password and connections and anyone who connected
    >>> to you will no longer be able to connect. A *compromised*
    >>> conf file means that other people can impersonate you on
    >>> the network.
  "
}

post_upgrade() {
  post_install
}

# vim: ts=2 sw=2 et:
