freebsd-ports/japanese/sj3-server/pkg-install
Hiroki Sato a8dc9708f7 - Separate the server part and the library part from japanese/sj3, and
remove japanese/sj3.
- Use localhost as the default listen address instead of INADDR_ANY.
- Add "servername" directive to serverrc.
- Fix incorrect descriptions in serverrc.
- Take maintainership.
2008-10-26 19:35:08 +00:00

37 lines
734 B
Bash

#!/bin/sh
# $FreeBSD$
PATH=/bin:/usr/sbin
case $2 in
PRE-INSTALL)
USER=_sj3
GROUP=${USER}
UID=912
GID=${UID}
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-d /nonexistent -s /usr/sbin/nologin -c "SJ3 Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
esac