Browse Source

MT#9065 daemon: don't restart if kernel is needed but not yet installed

vseva/9065
Victor Seva 11 years ago
parent
commit
7d1841294e
1 changed files with 35 additions and 0 deletions
  1. +35
    -0
      debian/ngcp-rtpengine-daemon.postinst

+ 35
- 0
debian/ngcp-rtpengine-daemon.postinst View File

@ -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

Loading…
Cancel
Save