ports/security/openvpn-devel/files/up-script.sample
Matthias Andree 1a400328a7 Update openvpn-devel to 2016-52 snapshot.
Align with security/openvpn for RC script improvements, dropping the
TUNNELBLICK patch (integrated upstream) and pkg-help file (no longer
required).

Note that pkcs11* and mbedTLS currently do not mix (I randomly checked
different option sets), an issue this port shares with security/openvpn.
"checking mbedtls pkcs11 support...
configure: error: mbedtls has no pkcs11 wrapper compiled in"

PR:		215734
Submitted by:	Eric F. Crist (maintainer)
2017-01-04 14:38:59 +00:00

27 lines
782 B
Bash

#!/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