Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2016 09:07:45 +0000 (UTC)
From:      Matthias Andree <mandree@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r405841 - head/security/openvpn/files
Message-ID:  <201601120907.u0C97jV6012290@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mandree
Date: Tue Jan 12 09:07:45 2016
New Revision: 405841
URL: https://svnweb.freebsd.org/changeset/ports/405841

Log:
  Add an 'up' script for resolvconf integration, ...
  
  contributed by Bapt@, but not yet touched up.
  Needs proper license notice and documentation.
  Therefore not yet linked to the build/install.

Added:
  head/security/openvpn/files/up-script.sample   (contents, props changed)

Added: head/security/openvpn/files/up-script.sample
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/openvpn/files/up-script.sample	Tue Jan 12 09:07:45 2016	(r405841)
@@ -0,0 +1,27 @@
+#!/bin/sh
+# OpenVPN simple up/down script for openresolvconf integration.
+# (C) Copyright 2016 Baptiste Daroussin
+# BSD 2-clause license.
+
+set -e +u
+: ${script_type:=down}
+case "${script_type}" in
+up)
+        i=1
+        while :; do
+                eval option=\"\$foreign_option_${i}\" || break
+                [ "${option}" ] || break
+                set -- ${option}
+                i=$((i + 1))
+                [ "$1" = "dhcp-option" ] || continue
+                case "$2" in
+                DNS)           echo "nameserver ${3}" ;;
+                DOMAIN)        echo "domain ${3}" ;;
+                DOMAIN-SEARCH) echo "search ${3}" ;;
+                esac
+        done | /sbin/resolvconf -a "${dev}"
+        ;;
+down)
+        /sbin/resolvconf -d "${dev}" -f
+        ;;
+esac



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601120907.u0C97jV6012290>