ports/net-p2p/libswift/files/libswift.in
Kurt Jaeger b6618efec3 New port: net-p2p/libswift
LibSwift is the reference UDP-based implementation of IETF RFC7574,
a multi-peer transport layer protocol. Its mission is to disseminate
content among a swarm of peers.

Given a root hash, the data is received from whatever source available
and data integrity is checked cryptographically with Merkle hash
trees.

WWW: https://tools.ietf.org/html/rfc7574

PR:		211945
Submitted by:	Dave Cottlehuber <dch@skunkwerks.at>
2016-08-17 18:10:01 +00:00

49 lines
1.2 KiB
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: libswift
# REQUIRE: LOGIN NETWORKING SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# libswift_enable (bool): Set to NO by default.
# Set it to YES to enable swift.
#
# libswift_user (user): Set to www by default.
# libswift_group (group): Set to www by default.
# libswift_port (num): Port for daemon to listen on, 7777 by default.
# libswift_dir (string): Optional full path to streaming content directory.
. /etc/rc.subr
name=libswift
rcvar=libswift_enable
load_rc_config ${name}
# defaults
libswift_enable=${libswift_enable:-"NO"}
libswift_user=${libswift_user:-"www"}
libswift_port=${libswift_port:-"7777"}
libswift_dir=${libswift_dir:-"/var/db/${name}"}
libswift_options=${libswift_options:-" --dir ${libswift_dir} --listen ${libswift_port}"}
# daemon
libswift_pidfile="%%SWIFT_PIDDIR%%${name}.pid"
procname="%%PREFIX%%/bin/${name}"
command=/usr/sbin/daemon
command_args=" -c -f -p ${libswift_pidfile} ${procname} ${libswift_flags} ${libswift_options}"
start_precmd=libswift_precmd
libswift_precmd()
{
# create empty pidfile with correct permissions
install -o ${libswift_user} /dev/null ${libswift_pidfile}
}
run_rc_command "$1"