1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-16 03:24:07 +00:00
freebsd-ports/audio/pulseaudio/pkg-install
Michael Johnson fe3afaa421 Add pkg-message
Pulseaudio is designed to run in realtime, to achieve this pulseaudio is
marked SUID root by default. To take advantage of pulseaudio's realtime
functionality you must be a member of the 'pulse-rt' group.

ie: 'pw mod group pulse-rt -m [USERNAME]'

Discussed with:	marcus
2008-04-02 14:20:47 +00:00

64 lines
1.4 KiB
Bash

#!/bin/sh
case $2 in
POST-INSTALL)
RGROUP=pulse-rt
SUSER=pulse
SGROUP=${SUSER}
AGROUP=pulse-access
SUID=563
RGID=557
SGID=${SUID}
AGID=564
PW=/usr/sbin/pw
if ${PW} group show "${RGROUP}" 2>/dev/null; then
echo "You already have a group \"${RGROUP}\", so I will use it."
else
if ${PW} groupadd ${RGROUP} -g ${RGID}; then
echo "Added group \"${RGROUP}\"."
else
echo "Adding group \"${RGROUP}\" failed..."
exit 1
fi
fi
if ${PW} group show "${SGROUP}" 2>/dev/null; then
echo "You already have a group \"${SGROUP}\", so I will use it."
else
if ${PW} groupadd ${SGROUP} -g ${SGID}; then
echo "Added group \"${SGROUP}\"."
else
echo "Adding group \"${SGROUP}\" failed..."
exit 1
fi
fi
if ${PW} group show "${AGROUP}" 2>/dev/null; then
echo "You already have a group \"${AGROUP}\", so I will use it."
else
if ${PW} groupadd ${AGROUP} -g ${AGID}; then
echo "Added group \"${AGROUP}\"."
else
echo "Adding group \"${AGROUP}\" failed..."
exit 1
fi
fi
if ${PW} user show "${SUSER}" 2>/dev/null; then
echo "You already have a user \"${SUSER}\", so I will use it."
else
if ${PW} useradd ${SUSER} -u ${SUID} -g ${SGROUP} -h - \
-d "/nonexistent" -s /sbin/nologin -c "PulseAudio System User"
then
echo "Added user \"${SUSER}\"."
else
echo "Adding user \"${SUSER}\" failed..."
exit 1
fi
fi
echo ""
exit 0
;;
esac