summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanipv6
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-05-10 12:46:50 +0000
committerSeth Mos <seth.mos@dds.nl>2011-05-10 12:46:50 +0000
commit9d15846737a498e3ed01c735b2f5b54a68cbf960 (patch)
tree8079baa9890ab6aa310c60ca4b0bf71b7ed319bc /etc/rc.newwanipv6
parentc65d30519a2436c82bddf4a617e5a3a60ca493d3 (diff)
downloadpfsense-9d15846737a498e3ed01c735b2f5b54a68cbf960.zip
pfsense-9d15846737a498e3ed01c735b2f5b54a68cbf960.tar.gz
Save the IPv6 DNS server and search domain to /var/etc/ so that system resolv conf picks it up.
Diffstat (limited to 'etc/rc.newwanipv6')
-rwxr-xr-xetc/rc.newwanipv619
1 files changed, 15 insertions, 4 deletions
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
<?php
/*
- rc.newwanipv6
+ rc.newwanip
Copyright (C) 2006 Scott Ullrich (sullrich@gmail.com)
- Copyright (C) 2011 Seth Mos (seth.mos@dds.nl)
part of pfSense (http://www.pfsense.com)
+ Originally part of m0n0wall (http://m0n0.ch)
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
+ 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)) {
OpenPOWER on IntegriCloud