mirror of
https://git.freebsd.org/ports.git
synced 2025-06-27 07:30:32 -04:00
37 lines
728 B
Bash
37 lines
728 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: pgreplicate
|
|
# REQUIRE: DAEMON
|
|
# BEFORE: pglb
|
|
# KEYWORD: FreeBSD
|
|
#
|
|
# Add the following line to /etc/rc.conf to enable pgreplicate:
|
|
#
|
|
# pgreplicate_enable="YES"
|
|
#
|
|
|
|
pgreplicate_enable=${pgreplicate_enable-"NO"}
|
|
pgreplicate_data=${pgreplicate_data-"%%PREFIX%%/pgsql/data"}
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
load_rc_config pgreplicate
|
|
|
|
name=pgreplicate
|
|
rcvar=`set_rcvar`
|
|
command=%%PREFIX%%/bin/pgreplicate
|
|
pgreplicate_user=pgsql
|
|
stop_cmd="pgreplicate_stop"
|
|
|
|
pgreplicate_flags="${pgreplicate_flags} -D ${pgreplicate_data}"
|
|
pidfile="${pgreplicate_data}/pgreplicate.pid"
|
|
|
|
pgreplicate_stop()
|
|
{
|
|
su -m ${pgreplicate_user} -c "exec ${command} -D ${pgreplicate_data} stop"
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|