freebsd-ports/japanese/postgresql-tcltk/files/pgsql.sh.tmpl
Akinori MUSHA 652c758fe7 Update to 7.1 with jumob-patch 20010429 and synchronize with
databases/postgresql7.

Include Japanezed psql (psqlj).

PR:		27156
Submitted by:	Saito Tomokatsu <saito@a2z.co.jp> (MAINTAINER)
2001-05-08 12:36:01 +00:00

36 lines
759 B
Bash

#!/bin/sh
# $FreeBSD$
#
# For postmaster startup options, edit $PGDATA/postgresql.conf
PGBIN=%%PREFIX%%/%%PG_PREFIX%%bin
case $1 in
start)
[ -d %%PREFIX%%/%%PG_PREFIX%%lib ] && /sbin/ldconfig -m %%PREFIX%%/%%PG_PREFIX%%lib
[ -x ${PGBIN}/pg_ctl ] && {
su -l pgsql -c \
'[ -d ${PGDATA} ] && exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl start -s -w -l ~pgsql/errlog'
echo -n ' pgsql'
}
;;
stop)
[ -x ${PGBIN}/pg_ctl ] && {
su -l pgsql -c 'exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl stop -s -m fast'
echo -n ' pgsql'
}
;;
status)
[ -x ${PGBIN}/pg_ctl ] && {
exec su -l pgsql -c 'exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl status'
}
;;
*)
echo "usage: `basename $0` {start|stop|status}" >&2
exit 64
;;
esac