You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

51 lines
1.1 KiB

#!/bin/sh
set -e
default=/etc/default/ngcp-rtpengine-daemon
modname=xt_RTPENGINE
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip kernel module check"
else
if [ -f $default ]; then
. $default || true
fi
if [ -n "$TABLE" ] && [ "$TABLE" -ge 0 ] && \
[ -n "$NO_FALLBACK" ] && \
{ [ "$NO_FALLBACK" = "1" ] || [ "$NO_FALLBACK" = "yes" ] ; }
then
if lsmod | grep -q $modname || modinfo $modname > /dev/null 2> /dev/null; then
true
else
echo "Kernel module $modname not found and NO_FALLBACK is set."
echo "Daemon restart not performed."
exit 0
fi
fi
fi
if [ "$1" = configure ]; then
adduser --system --home /nonexistent --gecos rtpengine \
--no-create-home --disabled-password \
--group --quiet rtpengine || true
for DIR in /var/spool/rtpengine; do
if ! dpkg-statoverride --list "$DIR" > /dev/null 2>&1; then
chown rtpengine:rtpengine "$DIR"
chmod 0770 "$DIR"
fi
done
fi
#DEBHELPER#
exit 0