MT#6485 add proper checks for virt-identify

pull/11/head
Victor Seva 12 years ago
parent 02832db063
commit eb9dbd87cc

@ -67,6 +67,12 @@ if test "$FORK" = "no" ; then
OPTIONS="$OPTIONS --foreground"
fi
if [ -x /usr/sbin/ngcp-virt-identify ]; then
if /usr/sbin/ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
case "$1" in
start)
set +e
@ -84,7 +90,7 @@ case "$1" in
esac
fi
echo -n "Starting $DESC: $NAME"
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
if [ $TABLE -ge 0 ] && [ "$VIRT" != "yes" ]; then
set +e
modprobe xt_MEDIAPROXY
if [ -e /proc/mediaproxy/control ]; then
@ -113,7 +119,7 @@ case "$1" in
if [ "$?" -ne 0 ]; then
return $?
fi
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
if [ $TABLE -ge 0 ] && [ "$VIRT" != "yes" ]; then
set +e
if [ -e /proc/mediaproxy/control ]; then
echo "del $TABLE" > /proc/mediaproxy/control 2>/dev/null
@ -150,7 +156,7 @@ case "$1" in
;;
esac
fi
if [ $TABLE -ge 0 ] && ! /usr/sbin/ngcp-virt-identify --type container; then
if [ $TABLE -ge 0 ] && [ "$VIRT" != "yes" ]; then
sleep 1
set +e
if [ -e /proc/mediaproxy/control ]; then

@ -8,7 +8,14 @@ name=ngcp-rtpengine
version=`dpkg-query -W -f='${Version}' "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
if /usr/sbin/ngcp-virt-identify --type container; then
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"
else
isadded=`dkms status -m "$name" -v "$version"`

@ -8,12 +8,18 @@ name=ngcp-rtpengine
version=`dpkg-query -W -f='${Version}' "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
if [ -x /usr/sbin/ngcp-virt-identify ]; then
if /usr/sbin/ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
# make sure it's not running
if [ -x /etc/init.d/ngcp-rtpengine-daemon ] ; then
invoke-rc.d ngcp-rtpengine-daemon stop || true
fi
if /usr/sbin/ngcp-virt-identify --type container; then
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
dkms remove -m "$name" -v "$version" --all || true

Loading…
Cancel
Save