freebsd-ports/audio/linux-shoutcast/pkg-install
Ion-Mihai Tetcu 766506c513 Shoutcast is Nullsoft's Winamp-based streaming audio server. It isn't
an open source software, but freely available for i386 versions of
FreeBSD 4.X/5.X and Linux. This port installs the Linux binary.

WWW: http://www.shoutcast.com

PR:		ports/95514
Submitted by:	Gabor Kovesdan
Approved by:	lawrance(mentor, implicit)
2006-06-05 10:39:01 +00:00

51 lines
1.2 KiB
Bash

#!/bin/sh
if [ "$2" != "POST-INSTALL" ]; then
exit 0
fi
SC_GROUP=shoutcast
SC_USER=shoutcast
SC_SHELL=/bin/sh
SC_HOME=/nonexistent
PW=/usr/sbin/pw
if ! ${PW} show group ${SC_GROUP} -q >/dev/null; then
gid=210
while ${PW} show group -g ${gid} -q >/dev/null; do
gid=`expr ${gid} + 1`
done
if ! ${PW} add group ${SC_GROUP} -g ${gid}; then
e=$?
echo "*** Failed to add group \`${SC_GROUP}'. Please add it manually."
exit ${e}
fi
echo "*** Added group \`${SC_GROUP}' (id ${gid})"
else
gid=`${PW} show group ${SC_GROUP} 2>/dev/null | cut -d: -f3`
fi
if ! ${PW} show user ${SC_USER} -q >/dev/null; then
uid=210
while ${PW} show user -u ${uid} -q >/dev/null; do
uid=`expr ${uid} + 1`
done
if ! ${PW} add user ${SC_USER} -u ${uid} -g ${gid} -d "${SC_HOME}" \
-c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \
; then
e=$?
echo "*** Failed to add user \`${SC_USER}'. Please add it manually."
exit ${e}
fi
echo "*** Added user \`${SC_USER}' (id ${uid})"
else
if ! ${PW} mod user ${SC_USER} -g ${gid} -d "${SC_HOME}" \
-c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \
; then
e=$?
echo "*** Failed to update user \`${SC_USER}'."
exit ${e}
fi
echo "*** Updated user \`${SC_USER}'."
fi