Project

General

Profile

Download (1.68 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php-cgi -f
2
<?php
3
/*
4
 * rc.newroutedns
5
 *
6
 * part of pfSense (https://www.pfsense.org)
7
 * Copyright (c) 2004-2013 BSD Perimeter
8
 * Copyright (c) 2013-2016 Electric Sheep Fencing
9
 * Copyright (c) 2014-2024 Rubicon Communications, LLC (Netgate)
10
 * All rights reserved.
11
 *
12
 * Licensed under the Apache License, Version 2.0 (the "License");
13
 * you may not use this file except in compliance with the License.
14
 * You may obtain a copy of the License at
15
 *
16
 * http://www.apache.org/licenses/LICENSE-2.0
17
 *
18
 * Unless required by applicable law or agreed to in writing, software
19
 * distributed under the License is distributed on an "AS IS" BASIS,
20
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
 * See the License for the specific language governing permissions and
22
 * limitations under the License.
23
 */
24

    
25
/* parse the configuration and include all functions used below */
26
require_once("util.inc");
27
require_once("config.inc");
28
require_once("functions.inc");
29
require_once("system.inc");
30

    
31
/* make sure to wait until the boot scripts have finished */
32
if (file_exists("{$g['varrun_path']}/booting")) {
33
	return;
34
}
35

    
36
// Get enabled static routes
37
$staticroutes = get_staticroutes(false, false, true);
38

    
39
if (count($staticroutes)) {
40
	log_error("Static Routes: One or more aliases used for routing has changed its IP. Refreshing.");
41
} else {
42
	return;
43
}
44

    
45
$routelck = lock('routedns', LOCK_EX);
46

    
47
/* We will walk the list of hostnames found in static routes
48
 * configuration. Since we are already triggered by filterdns
49
 * that a hostname has changed we can proceed to compare the
50
 * new IP address with the old address from the DNS cache.
51
 */
52
system_staticroutes_configure();
53

    
54
unlock($routelck);
55
?>
(56-56/85)