ports/misc/freeswitch-scripts/files/pkg-install.in
Josh Paetzel fb0d968816 Update to latest version.
Add files to pkg-plist
Add needed user and group if installed standalone
Smarter handling of magic file installed if used standalone

PR:	ports/152932
Submitted by:	Richard Neese <r.neese@gmail.com>
2010-12-17 21:42:33 +00:00

35 lines
872 B
Bash

#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/misc/freeswitch-scripts/files/pkg-install.in,v 1.1 2010-12-17 21:42:33 jpaetzel Exp $
#
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
FREESWITCHUSER=freeswitch
FREESWITCHGROUP=${FREESWITCHUSER}
FREESWITCHUID=610
FREESWITCHGID=${FREESWITCHUID}
if ! pw groupshow "${FREESWITCHGROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${FREESWITCHGROUP} -g ${FREESWITCHGID}; then
echo "Added group \"${FREESWITCHGROUP}\"."
else
echo "Adding group \"${FREESWITCHGROUP}\" failed..."
exit 1
fi
fi
if ! pw usershow "${FREESWITCHUSER}" 2>/dev/null 1>&2; then
if pw useradd ${FREESWITCHUSER} -u ${FREESWITCHUID} -g ${FREESWITCHGROUP} -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "FREESWITCH Owner"; \
then
echo "Added user \"${FREESWITCHUSER}\"."
else
echo "Adding user \"${FREESWITCHUSER}\" failed..."
exit 1
fi
fi
exit 0