#!/bin/sh # # $NetBSD: ip6addrctl,v 1.2.18.2 2020/01/31 11:19:58 martin Exp $ # FreeBSD: head/etc/rc.d/ip6addrctl 270836 2014-08-30 07:08:10Z hrs # # PROVIDE: ip6addrctl # REQUIRE: root bootconf mountcritlocal tty $_rc_subr_loaded . /etc/rc.subr name="ip6addrctl" rcvar="ip6addrctl" start_cmd="ip6addrctl_start" stop_cmd="ip6addrctl_stop" extra_commands="status prefer_ipv6 prefer_ipv4" status_cmd="ip6addrctl" prefer_ipv6_cmd="ip6addrctl_prefer_ipv6" prefer_ipv4_cmd="ip6addrctl_prefer_ipv4" config_file="/etc/ip6addrctl.conf" IP6ADDRCTL_CMD="/usr/sbin/ip6addrctl" ip6addrctl_prefer_ipv6() { ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 cat </dev/null 2>&1 cat </dev/null 2>&1 ${IP6ADDRCTL_CMD} install "${config_file}" else ip6addrctl_prefer_ipv6 fi ;; ipv4_prefer) ip6addrctl_prefer_ipv4 ;; ipv6_prefer) ip6addrctl_prefer_ipv6 ;; *) warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \ " \"ipv4_prefer\" is used instead." ip6addrctl_prefer_ipv4 ;; esac if checkyesno ip6addrctl_verbose; then echo 'Address selection policy table for IPv4 and IPv6:' ${IP6ADDRCTL_CMD} fi } ip6addrctl_stop() { ip6addrctl flush >/dev/null 2>&1 } load_rc_config $name run_rc_command "$1"