2 # postinst script for openvswitch-controller
4 # see: dh_installdeb(1)
8 # summary of how this script can be called:
9 # * <postinst> `configure' <most-recently-configured-version>
10 # * <old-postinst> `abort-upgrade' <new version>
11 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
13 # * <postinst> `abort-remove'
14 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15 # <failed-install-package> <version> `removing'
16 # <conflicting-package> <version>
17 # for details, see http://www.debian.org/doc/debian-policy/ or
18 # the debian-policy package
23 cd /etc/openvswitch-controller
25 # If cacert.pem is a symlink to the old location for cacert.pem,
26 # remove it so that we can symlink it to the new location.
27 if test -h cacert.pem && \
28 test X"`readlink cacert.pem`" = X/usr/share/openvswitch/pki/switchca/cacert.pem; then
32 if ! test -e cacert.pem; then
33 ln -s /var/lib/openvswitch/pki/switchca/cacert.pem cacert.pem
35 if ! test -e privkey.pem || ! test -e cert.pem; then
38 ovs-pki req+sign tmp controller >/dev/null
39 mv tmp-privkey.pem privkey.pem
40 mv tmp-cert.pem cert.pem
41 mv tmp-req.pem req.pem
42 chmod go+r cert.pem req.pem
47 abort-upgrade|abort-remove|abort-deconfigure)
51 echo "postinst called with unknown argument \`$1'" >&2