<commit_before># Copyright 2007-2008 <NAME> <<EMAIL>>
# All rights reserved. Released under the 2-clause BSD license.

tuntap_depend()
{
	before bridge interface macchanger
}

_config_vars="$_config_vars tunctl"

_is_tuntap()
{
	[ -n "$(export SVCNAME="net.${IFACE}"; service_get_value tuntap)" ]
}

tuntap_pre_start()
{
	local tuntap=
	eval tuntap=\$tuntap_${IFVAR}

	[ -z "${tuntap}" ] && return 0

	if [ ! -e /dev/net/tun ]; then
		modprobe tun && sleep 1
		if [ ! -e /dev/net/tun ]; then
			eerror "TUN/TAP support is not present in this kernel"
			return 1
		fi
	fi

	ebegin "Creating Tun/Tap interface ${IFACE}"

	# Set the base metric to 1000
	metric=1000

	if type tunctl >/dev/null 2>&1; then
		local opts=
		eval opts=\$tunctl_${IFVAR}
		tunctl ${opts} -t "${IFACE}" >/dev/null
	else
		openvpn --mktun --dev-type "${tuntap}" --dev "${IFACE}" >/dev/null
	fi
	eend $? && _up && service_set_value tuntap "${tuntap}"
}

tuntap_post_stop()
{
	_is_tuntap || return 0

	ebegin "Destroying Tun/Tap interface ${IFACE}"
	if type tunctl >/dev/null 2>&1; then
		tunctl -d "${IFACE}" >/dev/null
	else
		openvpn --rmtun \
			--dev-type "$(service_get_value tuntap)" \
			--dev "${IFACE}" >/dev/null
	fi
	eend $?
}
<commit_msg>Attempt to fix tun/tap issue on first boot.<commit_after># Copyright 2007-2008 <NAME> <<EMAIL>>
# All rights reserved. Released under the 2-clause BSD license.

tuntap_depend()
{
	before bridge interface macchanger
}

_config_vars="$_config_vars tunctl"

_is_tuntap()
{
	[ -n "$(export SVCNAME="net.${IFACE}"; service_get_value tuntap)" ]
}

tuntap_pre_start()
{
	local tuntap=
	eval tuntap=\$tuntap_${IFVAR}

	[ -z "${tuntap}" ] && return 0

	if [ ! -e /dev/net/tun ]; then
		if ! modprobe tun; then
			eerror "TUN/TAP support is not present in this kernel"
			return 1
		fi
	fi

	ebegin "Creating Tun/Tap interface ${IFACE}"

	# Set the base metric to 1000
	metric=1000

	if type tunctl >/dev/null 2>&1; then
		local opts=
		eval opts=\$tunctl_${IFVAR}
		tunctl ${opts} -t "${IFACE}" >/dev/null
	else
		openvpn --mktun --dev-type "${tuntap}" --dev "${IFACE}" >/dev/null
	fi
	eend $? && _up && service_set_value tuntap "${tuntap}"
}

tuntap_post_stop()
{
	_is_tuntap || return 0

	ebegin "Destroying Tun/Tap interface ${IFACE}"
	if type tunctl >/dev/null 2>&1; then
		tunctl -d "${IFACE}" >/dev/null
	else
		openvpn --rmtun \
			--dev-type "$(service_get_value tuntap)" \
			--dev "${IFACE}" >/dev/null
	fi
	eend $?
}

{'fraction_non_alphanumeric': 0.1614092585006145, 'fraction_numerical': 0.02007374027038099, 'mean_word_length': 3.5138632162661736, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5858389', 'n_tokens_mistral': 1087, 'n_tokens_neox': 998, 'n_words': 267}