From 9d15846737a498e3ed01c735b2f5b54a68cbf960 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Tue, 10 May 2011 12:46:50 +0000 Subject: Save the IPv6 DNS server and search domain to /var/etc/ so that system resolv conf picks it up. --- etc/rc.newwanipv6 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'etc/rc.newwanipv6') diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6 index 227b573..f5d1eaa 100755 --- a/etc/rc.newwanipv6 +++ b/etc/rc.newwanipv6 @@ -1,11 +1,13 @@ #!/usr/local/bin/php -f . + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -38,14 +40,15 @@ require_once("shaper.inc"); require_once("ipsec.inc"); require_once("vpn.inc"); require_once("openvpn.inc"); +require_once("IPv6.inc"); // Do not process while booting if($g['booting']) exit; -/* echo print_r($_ENV, true); -Array +// echo print_r($_ENV, true); +/*Array ( [REASON] => NBI [new_domain_name_servers] => 2001:470:20::2 @@ -68,6 +71,14 @@ $curwanip = get_interface_ipv6(); $interface = "wan"; $interface_real = get_real_interface(); +if(is_ipaddr(trim($_ENV['new_domain_name_servers']))) { + echo "DNS {$_ENV['new_domain_name_servers']}\n"; + file_put_contents("{$g['varetc_path']}/nameserver_v6{$interface}", trim($_ENV['new_domain_name_servers'])); +} +if(!empty($_ENV['new_domain_name'])) { + file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $_ENV['new_domain_name']); +} + log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real})."); if($curwanipv6 == "" || !is_ipaddrv6($curwanipv6)) { -- cgit v1.1