freebsd-ports/www/bigbluebutton/files/openoffice.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

58 lines
1.6 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: openoffice
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# openoffice_enable (bool): Set to NO by default.
# Set it to YES to enable openoffice.
# openoffice_user (username): Set to www by default.
# Set it to required username.
# openoffice_group (group): Set to www by default.
# Set it to required group.
# openoffice_home (string): Set to /var/spool/%%PORTNAME%% by default.
# Set it to required dir.
# openoffice_bin (string): Set by default - see below.
# Set it to soffice.bin path.
# openoffice_args (string): Set by default - see below.
# Set it to required command line args.
#
. /etc/rc.subr
name="openoffice"
rcvar=openoffice_enable
load_rc_config $name
: ${openoffice_enable:=NO}
: ${openoffice_user:="www"}
: ${openoffice_group:="www"}
: ${openoffice_home:="/var/spool/%%PORTNAME%%"}
: ${openoffice_bin:="%%SOFFICEBIN%%"}
: ${openoffice_args:="-accept=socket,host=localhost,port=8100;urp -headless -nofirststartwizard"}
pidfile=/var/run/${name}.pid
command="${openoffice_bin}"
start_cmd="${name}_start"
start_precmd="${name}_precmd"
openoffice_start() {
echo "Starting ${name}."
env HOME=${openoffice_home} /usr/sbin/daemon \
-f -p ${pidfile} -u ${openoffice_user} \
${openoffice_bin} ${openoffice_args}
}
openoffice_precmd() {
touch ${pidfile}
chown ${openoffice_user}:${openoffice_group} ${pidfile}
}
run_rc_command "$1"