
| Current Path : /var/lib/dpkg/info/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //var/lib/dpkg/info/coturn.postinst |
#!/bin/sh
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
# $1 = version of the package being upgraded.
install() {
TURNSERVER_GROUP=turnserver
if ! getent group "$TURNSERVER_GROUP" >/dev/null; then
addgroup --system "$TURNSERVER_GROUP" || exit 1
fi
TURNSERVER_USER=turnserver
if ! getent passwd "$TURNSERVER_USER" >/dev/null; then
adduser --system \
--home / \
--shell /bin/false \
--no-create-home \
--ingroup "$TURNSERVER_GROUP" \
--disabled-password \
--disabled-login \
--gecos "turnserver daemon" \
"$TURNSERVER_USER" || exit 1
fi
# Don't ship the empty database; generate it on-demand. (#929269)
TURNDB_SQLITE=/var/lib/turn/turndb
TURNDB_SCHEMA=/usr/share/doc/coturn/schema.sql
if [ ! -e "$TURNDB_SQLITE" ] && [ -e "$TURNDB_SCHEMA" ]; then
echo "I: Creating $TURNDB_SQLITE from $TURNDB_SCHEMA" >&2
mkdir -p "$(dirname "$TURNDB_SQLITE")"
sqlite3 "$TURNDB_SQLITE" < "$TURNDB_SCHEMA"
fi
}
case "$1" in
configure)
install "$2"
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_installinit/12.10ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/coturn" ]; then
update-rc.d coturn defaults >/dev/null
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
invoke-rc.d coturn $_dh_action || exit 1
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/12.10ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'coturn.service' >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'coturn.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'coturn.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'coturn.service' >/dev/null || true
fi
fi
# End automatically added section
exit 0