From 7d1841294ec26a5e685675a2bcd861aa3269a3c4 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 16 Sep 2014 20:56:57 +0200 Subject: [PATCH] MT#9065 daemon: don't restart if kernel is needed but not yet installed --- debian/ngcp-rtpengine-daemon.postinst | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 debian/ngcp-rtpengine-daemon.postinst diff --git a/debian/ngcp-rtpengine-daemon.postinst b/debian/ngcp-rtpengine-daemon.postinst new file mode 100644 index 000000000..7b1c8ec64 --- /dev/null +++ b/debian/ngcp-rtpengine-daemon.postinst @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +default=/etc/default/ngcp-rtpengine-daemon +name=ngcp-rtpengine + +if [ -x /usr/sbin/ngcp-virt-identify ]; then + if /usr/sbin/ngcp-virt-identify --type container; then + VIRT="yes" + fi +fi + +if [ "$VIRT" = "yes" ]; then + echo "Container environment detected. Skip dkms check" +else + fallback=$(awk '/^NO_FALLBACK=(1|yes)/ { print "yes" }' "$default") + + if [ -x /usr/sbin/dkms ]; then + isadded=`dkms status -m "$name"` + else + isadded="no" + fi + + if [ "${fallback}" = "yes" ] && [ "x${isadded}" = "x" ] ; then + echo "dkms module not found and NO_FALLBACK set to 'yes'" + echo "Don't restart yet, ngcp-rtpengine-kernel-dkms will try" + exit 0 + fi +fi + +#DEBHELPER# + +exit 0 +