Project

General

Profile

Download (2.03 KB) Statistics
| Branch: | Tag: | Revision:
1 cb7d18d5 Renato Botelho
#!/usr/local/bin/php-cgi -f
2 243f00e7 Scott Ullrich
<?php
3
/*
4 ce77a9c4 Phil Davis
	rc.newipsecdns
5 243f00e7 Scott Ullrich
	part of m0n0wall (http://m0n0.ch/wall)
6 e173dd74 Phil Davis
7 243f00e7 Scott Ullrich
	Copyright (C) 2007 Manuel Kasper <mk@neon1.net>.
8 6216690b smos
	Copyright (C) 2009 Seth Mos <seth.mos@dds.nl>.
9 243f00e7 Scott Ullrich
	All rights reserved.
10 e173dd74 Phil Davis
11 243f00e7 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13 e173dd74 Phil Davis
14 243f00e7 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16 e173dd74 Phil Davis
17 243f00e7 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20 e173dd74 Phil Davis
21 243f00e7 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32
33 de0de382 Ermal
/* parse the configuration and include all functions used below */
34
require_once("util.inc");
35
require_once("config.inc");
36
require_once("gwlb.inc");
37
require_once("functions.inc");
38 e173dd74 Phil Davis
require_once("filter.inc");
39
require_once("shaper.inc");
40 1d75a92f Ingo Bauersachs
require_once("auth.inc");
41 de0de382 Ermal
require_once("ipsec.inc");
42
require_once("vpn.inc");
43 483e6de8 Scott Ullrich
44 de0de382 Ermal
/* make sure to wait until the boot scripts have finished */
45 e173dd74 Phil Davis
if (file_exists("{$g['varrun_path']}/booting")) {
46 de0de382 Ermal
	return;
47 e173dd74 Phil Davis
}
48 de0de382 Ermal
49 da249a00 jim-p
if (ipsec_enabled()) {
50 7ddfa922 jim-p
	sleep(15);
51 de0de382 Ermal
	log_error("IPSEC: One or more IPsec tunnel endpoints has changed its IP. Refreshing.");
52 e173dd74 Phil Davis
} else {
53 de0de382 Ermal
	return;
54 e173dd74 Phil Davis
}
55 de0de382 Ermal
56
$ipseclck = lock('ipsecdns', LOCK_EX);
57
58
vpn_ipsec_configure();
59 72bd8df5 Ermal Lu?i
60 de0de382 Ermal
unlock($ipseclck);
61 243f00e7 Scott Ullrich
?>