debian: Move PKI directory to FHS-compliant location.
[sliver-openvswitch.git] / debian / openvswitch-controller.postinst
index 51acfb1..3073dc0 100755 (executable)
@@ -21,8 +21,16 @@ set -e
 case "$1" in
     configure)
         cd /etc/openvswitch-controller
+
+        # If cacert.pem is a symlink to the old location for cacert.pem,
+        # remove it so that we can symlink it to the new location.
+        if test -h cacert.pem && \
+           test X"`readlink cacert.pem`" = X/usr/share/openvswitch/pki/switchca/cacert.pem; then
+            rm -f cacert.pem
+        fi
+
         if ! test -e cacert.pem; then
-            ln -s /usr/share/openvswitch/pki/switchca/cacert.pem cacert.pem
+            ln -s /var/lib/openvswitch/pki/switchca/cacert.pem cacert.pem
         fi
         if ! test -e privkey.pem || ! test -e cert.pem; then
             oldumask=$(umask)