| 1 |
#! /bin/sh |
| 2 |
# postinst script for pulseaudio |
| 3 |
|
| 4 |
set -e |
| 5 |
|
| 6 |
# summary of how this script can be called: |
| 7 |
# * <postinst> `configure' <most-recently-configured-version> |
| 8 |
# * <old-postinst> `abort-upgrade' <new version> |
| 9 |
# * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
| 10 |
# <new-version> |
| 11 |
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
| 12 |
# <failed-install-package> <version> `removing' |
| 13 |
# <conflicting-package> <version> |
| 14 |
# for details, see http://www.debian.org/doc/debian-policy/ or |
| 15 |
# the debian-policy package |
| 16 |
|
| 17 |
PULSEAUDIO=/usr/bin/pulseaudio |
| 18 |
|
| 19 |
trigger_udev() { |
| 20 |
if ! which udevadm >/dev/null 2>&1 ; then |
| 21 |
return 0; |
| 22 |
fi |
| 23 |
udevadm control --reload-rules || true |
| 24 |
udevadm trigger --subsystem-match=sound --action=change || true |
| 25 |
} |
| 26 |
|
| 27 |
case "$1" in |
| 28 |
configure) |
| 29 |
if ! getent passwd pulse >/dev/null; then |
| 30 |
adduser --disabled-password --quiet --system \ |
| 31 |
--home /run/pulse --no-create-home\ |
| 32 |
--gecos "PulseAudio daemon" --group pulse |
| 33 |
adduser --quiet pulse audio |
| 34 |
fi |
| 35 |
if ! getent group pulse-access >/dev/null; then |
| 36 |
addgroup --quiet --system pulse-access |
| 37 |
fi |
| 38 |
trigger_udev |
| 39 |
;; |
| 40 |
abort-upgrade|abort-remove|abort-deconfigure) |
| 41 |
;; |
| 42 |
*) |
| 43 |
echo "postinst called with unknown argument \`$1'" >&2 |
| 44 |
exit 1 |
| 45 |
;; |
| 46 |
esac |
| 47 |
|
| 48 |
#DEBHELPER# |
| 49 |
|
| 50 |
exit 0 |