freebsd-ports/sysutils/rubygem-chef/files/chef_client.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

48 lines
1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: chef_client
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable chef-client
#
# chef_client_enable="YES"
. /etc/rc.subr
name="chef_client"
rcvar=chef_client_enable
# Read configuration and set defaults
load_rc_config $name
: ${chef_client_enable="NO"}
: ${chef_client_configfile="%%PREFIX%%/etc/chef/client.rb"}
: ${chef_client_interval="600"}
: ${chef_client_splay="0"}
: ${chef_client_logfile="/var/log/chef-client.log"}
: ${chef_client_loglevel="info"}
if [ -n "$chef_client_nodename" ]
then
nodename="-N ${chef_client_nodename}"
else
nodename=""
fi
if [ -n "$chef_client_server" ]
then
server="-N ${chef_client_server}"
else
server=""
fi
command="%%PREFIX%%/bin/chef-client"
command_interpreter="%%RUBY%%"
chef_client_flags="-c ${chef_client_configfile} ${nodename}${server}-d -i ${chef_client_interval} -s ${chef_client_splay} -L ${chef_client_logfile} -l ${chef_client_loglevel}"
load_rc_config $name
run_rc_command "$1"