freebsd-ports/audio/slimserver/pkg-install
Brooks Davis b2ba59343e - Upgrade to 5.1.5.
- Create empty config file on the first startup to allow
  settings to be saved.
- Fix shutdown on 4.x and some 5.x systems. [0]
- Remove unnecessicary p5-URI dependency, p5-libwww handles
  it for us.
- Add p5-Template-Toolkit dependency.
- Remove some EXCLUDE_FILES already handled by EXCLUDE_DIRS
- Fix message about SLIMDIR. [0]
- Add a newsyslog.conf entry for the log file. [0]
- Add a pkg-message warning about the open defaults of the server. [0]

PR:		ports/65799
Submitted by:   Dan Pelleg <daniel at pelleg.org> [0]
Approved by:	krion (mentor)
2004-05-03 22:59:03 +00:00

55 lines
1.3 KiB
Bash

#!/bin/sh
# $FreeBSD$
name=slimserver
u=slimserv
g=slimserv
ugid=104
homedir=/nonexistent
shell=/sbin/nologin
comment="Slim Devices SlimServer pseudo-user"
statedir=/var/db/slimserver
pidfile=/var/run/${name}.pid
logfile=/var/log/slimserver.log
logcomment="# added by audio/slimserver port"
logline="${logfile} ${u}:${g} 644 3 100 * Z ${pidfile}"
case $2 in
PRE-INSTALL)
if pw group show "${g}" >/dev/null 2>&1; then
echo "Using existing group \"${g}\"."
else
echo "Creating group \"${g}\", (gid: ${ugid})."
pw groupadd ${g} -g ${ugid}
if [ $? != 0 ]; then
echo "Failed to add group \"${g}\"."
exit 1
fi
fi
if pw user show "${u}" >/dev/null 2>&1; then
echo "Using existing user \"${u}\"."
else
echo "Creating user \"${u}\", (uid: ${ugid})."
pw useradd ${u} -u ${ugid} -g ${ugid} -h - \
-d ${homedir} -s ${shell} -c "${comment}"
if [ $? != 0 ]; then
echo "Failed to add user \"${u}\"."
exit 1
fi
fi
;;
POST-INSTALL)
if [ ! -d ${statedir} ]; then
mkdir -p ${statedir}
chown -R ${u}:${g} ${statedir}
fi
if egrep -q "^${logfile}\>" /etc/newsyslog.conf; then
echo "Using existing /etc/newsyslog.conf entry."
else
echo "Adding slimserver log entry to /etc/newsyslog.conf."
echo "$logcomment" >> /etc/newsyslog.conf
echo "$logline" >> /etc/newsyslog.conf
fi
;;
esac