#!/bin/sh # PROVIDE: cruisecontrolrb # REQUIRE: DAEMON # KEYWORD: shutdown # # This script is modified by placing the following variables inside # /etc/rc.conf.local, /etc/rc.conf, or /etc/rc.conf.d/cruisecontrolrb: # # cruisecontrolrb_enable (bool): # Set it to YES to enable this service. # Default: NO # cruisecontrolrb_port (port): # Set it to a port # Default: 3333 . %%RC_SUBR%% name=cruisecontrolrb rcvar=${name}_enable command="%%WWWDIR%%/cruise" load_rc_config $name : ${cruisecontrolrb_enable="NO"} : ${cruisecontrolrb_port="3333"} command_args="-p ${curisecontrolrb_port}" start_cmd="cruisecontrolrb_cmd start" stop_cmd="cruisecontrolrb_cmd stop" restart_cmd="cruisecontrolrb_restart" cruisecontrolrb_cmd() { if [ ${command} = "start" ]; then command_args="${command_args} -d" fi ${command} $1 ${command_args} } cruisecontrolrb_restart() { ${command} stop ${command} start ${command_args} }