Created
August 1, 2015 23:29
-
-
Save saces/2d941535ce5d27774e64 to your computer and use it in GitHub Desktop.
simple FreeBSD rc.d wrapper for freenet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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} | |
# : ${freenet_flags:=--syslog --reuseaddr --detach} | |
command="/usr/home/freenet/freenet08/run.sh" | |
# command_args="$1" | |
#PATH="${PATH}:/usr/local/libexec/git-core" | |
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment