freebsd-ports/www/jakarta-tomcat4/files/startup.sh
Ernst de Haan 15db7d6349 Improved the startup script. Always displaying a space first
before the name of the application being started/stopped. The
advantage is that if there is an error, then the message will
have a space prepended instead of being appended to the previous
application name.
When the application is 'stop'ped, the error messages, if any,
are now hidden. Instead the name of the application is just
shown.
Bumped PORTREVISION.
2002-05-08 21:54:06 +00:00

34 lines
667 B
Bash

#!/bin/sh
# -*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
# %%APP_TITLE%% startup script.
#
# $FreeBSD$
#
# Set some variables
MYSELF=`basename $0`
case "$1" in
start)
echo -n ' '
truncate -s 0 %%PID_FILE%%
chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% start" >/dev/null && echo -n '%%APP_SHORTNAME%%'
;;
stop)
echo -n ' '
chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% stop" >/dev/null 2>&1 ; echo -n '%%APP_SHORTNAME%%'
;;
*)
echo ""
echo "Usage: ${MYSELF} { start | stop }"
echo ""
exit 64
;;
esac