%pre
# add user/group asterisk/asterisk so we can run asterisk as the
# asterisk user for better security
# if not exist add the asterisk group
if grep -c "^asterisk:" /etc/group >> /dev/null ; then
:
else
# add the asterisk group (system account)
/usr/sbin/groupadd -r -f asterisk
fi
# if not exist add the asterisk user
if grep -c "^asterisk:" /etc/passwd >> /dev/null ; then
:
else
# add the asterisk user (system account)
/usr/sbin/useradd -c "Asterisk VoIP PBX" -g asterisk \
-r -s /sbin/nologin -m -d %{_localstatedir}/lib/asterisk \
asterisk 2> /dev/null
fi