Browse Source

Install the module load helper to etc/modules-load.d/. Closes: #798774

Christoph Biedl 5 years ago
parent
commit
594c136ab1
4 changed files with 36 additions and 0 deletions
  1. 0 0
      debian/modules-load.conf
  2. 23 0
      debian/pptpd.postinst
  3. 12 0
      debian/pptpd.preinst
  4. 1 0
      debian/rules

debian/pptpd.modprobe → debian/modules-load.conf


+ 23 - 0
debian/pptpd.postinst

@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+configure)
+    # load the module configured in /etc/modules-load.d/pptpd.conf
+    if [ -x "$(which systemctl || true)" ] ; then
+        systemctl restart systemd-modules-load
+    else
+        modprobe nf_nat_pptp 2>/dev/null || true
+    fi
+    ;;
+abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+*)
+    echo "postinst called with unknown argument '$1'"
+    exit 1
+    ;;
+esac
+
+#DEBHELPER#
+exit 0

+ 12 - 0
debian/pptpd.preinst

@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+dpkg-maintscript-helper mv_conffile \
+    /etc/modprobe.d/pptpd.conf \
+    /etc/modules-load.d/pptpd.conf \
+    1.4.0-9~ \
+    -- "$@"
+
+#DEBHELPER#
+exit 0

+ 1 - 0
debian/rules

@@ -14,6 +14,7 @@ override_dh_auto_configure:
 
 override_dh_install:
 	dh_install --fail-missing
+	install -D -m 644 debian/modules-load.conf debian/pptpd/etc/modules-load.d/pptpd.conf
 
 override_dh_installdocs:
 	dh_installdocs --exclude=test.txt