#!/bin/sh

#
# Aspera HTTPD initialization script
#
# Aspera, Inc.
#

. /etc/rc.subr

name="asperahttpd"
rcvar=`set_rcvar`

command="/usr/local/aspera/sbin/asperahttpd"
pidfile="/var/run/aspera/asperahttpd.pid"

sig_reload="HUP"

start_precmd="${name}_prestart"
start_postcmd="${name}_poststart"
stop_postcmd="${name}_poststop"
status_cmd="${name}_status"

asperahttpd_enable="YES"

asperahttpd_status() {
    echo "Not yet implemented"; exit 1
}

asperahttpd_prestart()
{
}

asperahttpd_poststart()
{
    # FIXME: asperahttpd must write out pid file
    pgrep asperahttpd > $pidfile
}

asperahttpd_poststop()
{
    rm -f $pidfile
}

load_rc_config $name
run_rc_command "$1"


