From 86d212c617768481b241446cba78308d861576d9 Mon Sep 17 00:00:00 2001 From: Ryan Steinmetz Date: Wed, 2 May 2018 22:04:17 +0000 Subject: [PATCH] - Add rc script for stubby Requested by: Augustus Africa --- dns/getdns/Makefile | 1 + dns/getdns/files/stubby.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 dns/getdns/files/stubby.in diff --git a/dns/getdns/Makefile b/dns/getdns/Makefile index fa1827dbf95a..81e2fe6a32c3 100644 --- a/dns/getdns/Makefile +++ b/dns/getdns/Makefile @@ -47,6 +47,7 @@ LIBUV_LIB_DEPENDS= libuv.so:devel/libuv LIBUV_CONFIGURE_WITH= libuv STUBBY_LIB_DEPENDS= libyaml.so:textproc/libyaml STUBBY_CONFIGURE_WITH= stubby +STUBBY_VARS= USE_RC_SUBR="stubby" post-patch: ${REINPLACE_CMD} -Ee 's,^(sharedoc = ).*,\1${WRKDIR}/doc,' \ diff --git a/dns/getdns/files/stubby.in b/dns/getdns/files/stubby.in new file mode 100644 index 000000000000..e9977584ac64 --- /dev/null +++ b/dns/getdns/files/stubby.in @@ -0,0 +1,34 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: stubby +# REQUIRE: NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: shutdown + +# +# Add some of the following variables to /etc/rc.conf to configure stubby: +# stubby_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable stubby. +# stubby_config (str): Default "%%PREFIX%%/etc/stubby.conf" +# Set it to the full path to the config file +# that stubby will use during the automated +# start-up. + +. /etc/rc.subr + +name="stubby" +rcvar=stubby_enable + +load_rc_config $name + +: ${stubby_enable="NO"} +: ${stubby_config="%%PREFIX%%/etc/stubby/stubby.yml"} + +command="%%PREFIX%%/bin/stubby" +command_args="-g -C ${stubby_config}" + +required_files=${stubby_config} +run_rc_command "$1"