#!/bin/bash

set -eu

#DEBHELPER#

case "${1}" in
  configure)
     {
	echo -n "** "
	date
	openvpn3-admin version
	openvpn3-admin init-config --write-configs
	echo "------------------"
     } &>> /var/lib/openvpn3/openvpn3-init-config.log || :
    ;;

  abort-upgrade|abort-remove|abort-deconfigure)
    ;;

  *)
    echo "postinst called with unknown argument \`${1}'" >&2
    exit 1
    ;;
esac
