freebsd-ports/devel/p4p/files/perforce.sh.in
Edwin Groothuis 6a661f7c16 Maintainer update: Perforce has released new version for i386, 2002.2
PR:		ports/46745
Submitted by:	David Marshall <marshall@chezmarshall.com>
2003-01-30 06:47:58 +00:00

47 lines
1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
p4d=@PREFIX@/sbin/p4d
p4ftpd=@PREFIX@/sbin/p4ftpd
p4p=@PREFIX@/sbin/p4p
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
if [ -x $p4p -a x$PERFORCE_PROXY_START = xyes ]; then
echo -n ' p4p'
$p4p $PERFORCE_PROXY_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
if [ -x $p4p ]; then
killall -u 0 p4p > /dev/null 2>&1 && echo -n ' p4p'
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 64
;;
esac