freebsd-ports/devel/p4d/files/perforce.sh.in
Akinori MUSHA df5a274627 - Update to version 01.1
- Support the alpha platform (although it is still at version 99.1)
- Install p4ftpd
- Create a non-privileged user and run p4d as the user
- Dig directories and make the port plug-and-play
- Change the configuration file's name to perforce.conf
- Do not unconditionally remove perforce.conf on deinstall
- Make almost all parameters (including directory layouts and
  user/group names) configurable via make variables
- Make the startup script support "restart"
- Take over the maintainership

Approved by:	Samuel Tardieu <sam@inf.enst.fr> (ex. MAINTAINER)
2001-09-01 18:57:08 +00:00

39 lines
828 B
Bash

#!/bin/sh
#
# $FreeBSD$
p4d=@PREFIX@/sbin/p4d
p4ftpd=@PREFIX@/sbin/p4ftpd
case $1 in
start)
[ -f @PREFIX@/etc/perforce.conf ] && . @PREFIX@/etc/perforce.conf
if [ -x $p4d -a x$PERFORCE_START = xyes ]; then
echo -n ' p4d'
su -fm $PERFORCE_USER -c "$p4d -r $PERFORCE_ROOT $PERFORCE_OPTIONS"
fi
if [ -x $p4ftpd -a x$PERFORCE_FTPD_START = xyes ]; then
echo -n ' p4ftpd'
$p4ftpd $PERFORCE_FTPD_OPTIONS
fi
;;
stop)
[ -f @PREFIX@/etc/perforce.conf ] && . @PREFIX@/etc/perforce.conf
if [ -x $p4ftpd ]; then
killall -u 0 p4ftpd >/dev/null 2>&1 && echo -n ' p4ftpd'
fi
if [ -x $p4d ]; then
killall -u $PERFORCE_USER p4d >/dev/null 2>&1 && echo -n ' p4d'
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 64
;;
esac