Skip to content

Simple FreeBSD rc.d wrapper for freenet

Stephen Oliver edited this page Oct 31, 2016 · 1 revision
#! /bin/sh
#
# $FreeBSD:$
#

# PROVIDE: freenet
# REQUIRE: LOGIN
# KEYWORD: shutdown

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

. /etc/rc.subr

name="freenet"
rcvar="freenet_enable"

load_rc_config $name

start_cmd=freenet_start
stop_cmd=freenet_stop
status_cmd=freenet_status

pidfile=/usr/home/freenet/freenet08/Freenet.pid

: ${freenet_user:=freenet}
: ${freenet_group:=freenet}
: ${freenet_enable:=NO}
: ${freenet_directory:=/usr/home/freenet/freenet08}

command="/usr/home/freenet/freenet08/run.sh"

freenet_start()
{
    su -m freenet -c "${command} start"
}

freenet_status()
{
    su -m freenet -c "${command} status"
}

freenet_stop()
{
    su -m freenet -c "${command} stop"
}

run_rc_command "$1" 
Clone this wiki locally
You can’t perform that action at this time.