#!/bin/sh
#
# ispCP ω (OMEGA) a Virtual Hosting Control Panel
# Copyright (C) 2006-2010 by isp Control Panel - http://ispcp.net
#
# Version: $Id: ispcp_daemon 2829 2010-04-15 00:04:56Z nuxwin $
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is "ispCP ω (OMEGA) a Virtual Hosting Control Panel".
#
# The Initial Developer of the Original Code is ispCP Team.
# Portions created by Initial Developer are Copyright (C) 2006-2010 by
# isp Control Panel. All Rights Reserved.
#
# The ispCP ω Home Page is:
#
#    http://isp-control.net
#

# PROVIDE: ispcp_daemon
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable ispcp_daemon:
#
#ispcp_daemon_enable="YES"
#

. /etc/rc.subr

name=ispcp_daemon
rcvar=`set_rcvar`

command=/usr/local/www/ispcp/daemon/ispcp_daemon
pidfile=/var/run/ispcp-daemon.pid

stop_postcmd=stop_postcmd

stop_postcmd() {
  rm -f $pidfile
}

# set defaults

ispcp_daemon_enable=${ispcp_daemon_enable:-"NO"}
ispcp_daemon_flags=${ispcp_daemon_flags:-""}

extra_commands="reload"

load_rc_config $name
run_rc_command "$1"
