Project

General

Profile

« Previous | Next » 

Revision 243f00e7

Added by Scott Ullrich over 17 years ago

Adding dnswatch support.

Obtained-from: m0n0wall

View differences:

etc/rc.newipsecdns
1
#!/usr/local/bin/php -f
2
<?php
3
/*
4
	$Id$
5
	part of m0n0wall (http://m0n0.ch/wall)
6
	
7
	Copyright (C) 2007 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9
	
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
	
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
	
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
	
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31

  
32
	/* parse the configuration and include all functions used below */
33
	require_once("config.inc");
34
	require_once("functions.inc");
35
	
36
	/* the IP address that a tunnel's remote gateway host name resolves
37
	   to has changed; reload IPsec completely (we can't only change one
38
	   specific tunnel at this time) */
39
	
40
	/* make sure to wait until the boot scripts have finished */
41
	while (file_exists("{$g['varrun_path']}/booting")) {
42
		sleep(1);
43
	}
44
	
45
	vpn_ipsec_configure();
46
?>
usr/local/www/vpn_ipsec_edit.php
183 183
			$t++;
184 184
		}
185 185
	}
186
	if (($_POST['remotegw'] && !is_ipaddr($_POST['remotegw']))) {
187
		if(is_domain($_POST['remotegw']) == false)
188
			$input_errors[] = "A valid remote gateway address must be specified.";
189
	}
186
	if (($_POST['remotegw'] && !is_ipaddr($_POST['remotegw']) && !is_domain($_POST['remotegw']))) 
187
		$input_errors[] = "A valid remote gateway address or host name must be specified.";
190 188
	if (($_POST['remotegw'] && is_ipaddr($_POST['remotegw']) && !isset($_POST['disabled']) )) {
191 189
		$t = 0;
192 190
		foreach($a_ipsec as $tunnel) {
......
423 421
                  <td width="78%" class="vtable">
424 422
                    <?=$mandfldhtml;?><input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="20" value="<?=$pconfig['remotegw'];?>">
425 423
                    <br>
426
                    Enter the public IP address of the remote gateway</td>
424
                    Enter the public IP address or host name of the remote gateway</td>
427 425
                </tr>
428 426
                <tr>
429 427
                  <td width="22%" valign="top" class="vncell">Description</td>

Also available in: Unified diff