From b7f8411df2630f83fb66e35693340bb4a5223caa Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Fri, 18 Mar 2011 12:18:52 +0000 Subject: [PATCH] Add resolvconf(8) which manages resolv.conf. --- etc/mtree/BSD.root.dist | 2 ++ sbin/Makefile | 1 + sbin/resolvconf/Makefile | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 sbin/resolvconf/Makefile diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index ce8a4562d820..a6cba2474491 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -72,6 +72,8 @@ .. .. libexec + resolvconf + .. .. media .. diff --git a/sbin/Makefile b/sbin/Makefile index 0623574c1d65..f9ba4cae65aa 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -62,6 +62,7 @@ SUBDIR=adjkerntz \ rcorder \ reboot \ recoverdisk \ + resolvconf \ restore \ route \ savecore \ diff --git a/sbin/resolvconf/Makefile b/sbin/resolvconf/Makefile new file mode 100644 index 000000000000..18ef240d8465 --- /dev/null +++ b/sbin/resolvconf/Makefile @@ -0,0 +1,37 @@ +# $FreeBSD$ + +DIST= ${.CURDIR}/../../contrib/openresolv +.PATH: ${DIST} + +SCRIPTS= resolvconf + +FILES= libc dnsmasq named pdnsd unbound +FILESDIR= /libexec/resolvconf + +MAN= resolvconf.conf.5 resolvconf.8 + +CLEANFILES= ${SCRIPTS} ${FILES} ${MAN} + +SYSCONFDIR= /etc +RCDIR= ${SYSCONFDIR}/rc.d +VARDIR= /var/run/resolvconf + +# We don't assume to restart the services in /sbin. So, though +# our service(8) is in /usr/sbin, we can use it, here. +CMD1= \1 onestatus >/dev/null 2>\&1 +CMD2= \1 restart +RESTARTCMD= /usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2} + +.for f in ${SCRIPTS} ${FILES} ${MAN} +${f}: ${f}.in + sed -e 's:@PREFIX@::g' \ + -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ + -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ + -e 's:@VARDIR@:${VARDIR}:g' \ + -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \ + -e 's:@RCDIR@:${RCDIR}:g' \ + -e 's: vpn : ng[0-9]*&:g' \ + ${DIST}/$@.in > $@ +.endfor + +.include