2006-10-14 08:35:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
case $2 in
|
|
|
|
POST-INSTALL)
|
2007-07-13 06:40:50 +00:00
|
|
|
RGROUP=pulse-rt
|
2007-04-30 00:20:33 +00:00
|
|
|
SUSER=pulse
|
|
|
|
SGROUP=${SUSER}
|
|
|
|
AGROUP=pulse-access
|
|
|
|
SUID=563
|
|
|
|
RGID=557
|
|
|
|
SGID=${SUID}
|
|
|
|
AGID=564
|
2006-10-14 08:35:50 +00:00
|
|
|
PW=/usr/sbin/pw
|
|
|
|
|
2007-04-30 00:20:33 +00:00
|
|
|
if ${PW} group show "${RGROUP}" 2>/dev/null; then
|
|
|
|
echo "You already have a group \"${RGROUP}\", so I will use it."
|
2006-10-14 08:35:50 +00:00
|
|
|
else
|
2007-04-30 00:20:33 +00:00
|
|
|
if ${PW} groupadd ${RGROUP} -g ${RGID}; then
|
|
|
|
echo "Added group \"${RGROUP}\"."
|
2006-10-14 08:35:50 +00:00
|
|
|
else
|
2007-04-30 00:20:33 +00:00
|
|
|
echo "Adding group \"${RGROUP}\" failed..."
|
2006-10-14 08:35:50 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-04-30 00:20:33 +00:00
|
|
|
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
|
2008-04-02 14:20:47 +00:00
|
|
|
echo ""
|
2006-10-14 08:35:50 +00:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|