summaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/postinst')
-rw-r--r--debian/postinst15
1 files changed, 12 insertions, 3 deletions
diff --git a/debian/postinst b/debian/postinst
index 22dd623..672a8d2 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -11,14 +11,23 @@ test $DEBIAN_SCRIPT_DEBUG && set -v -x
case "$1" in
configure)
- # get rid of confiles installed by mistake
- rm -f /etc/network/if-up.d/openvpn.if-up.d || true
- rm -f /etc/network/if-down.d/openvpn.if-down.d || true
db_get openvpn/create_tun || RET="false"
if [ "$RET" = "true" ]; then
[ -e /dev/net ] || mkdir -m 755 /dev/net
[ -d /dev/net -a ! -e /dev/net/tun ] && mknod /dev/net/tun c 10 200
fi
+ # move /run/openvpn.foo.pid to (subdir) /run/openvpn/foo.pid
+ if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.3.2-6 ; then
+ mkdir -p /run/openvpn
+ for f in $(ls /var/run/openvpn.*.pid /var/run/openvpn.*.status 2>/dev/null); do
+ mv "$f" "/run/openvpn/$(basename $f | sed 's/^openvpn\.//')"
+ done
+ fi
+ for f in /run/sendsigs.omit.d/openvpn.*.pid; do
+ [ -e "$f" ] && continue
+ b="$(basename $f|sed 's/openvpn\.//')"
+ ln -sf "/run/openvpn/$b" "/run/sendsigs.omit.d/openvpn.$b"
+ done
;;
esac