1
|
#!/usr/local/bin/php-cgi -f
|
2
|
<?php
|
3
|
/*
|
4
|
* rc.dyndns.update
|
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-2019 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
|
require_once("config.inc");
|
26
|
require_once("gwlb.inc");
|
27
|
require_once("functions.inc");
|
28
|
require_once("filter.inc");
|
29
|
require_once("shaper.inc");
|
30
|
|
31
|
/* Interface IP address has changed */
|
32
|
|
33
|
if (isset($_GET['dyndns'])) {
|
34
|
$argument = $_GET['dyndns'];
|
35
|
} else {
|
36
|
$argument = trim($argv[1], " \n");
|
37
|
}
|
38
|
|
39
|
if (empty($argument) || $argument == "all") {
|
40
|
services_dyndns_configure();
|
41
|
services_dnsupdate_process();
|
42
|
} else {
|
43
|
$interface = lookup_gateway_interface_by_name($argument);
|
44
|
if (empty($interface)) {
|
45
|
$interface = $argument;
|
46
|
}
|
47
|
services_dyndns_configure($interface);
|
48
|
services_dnsupdate_process($interface);
|
49
|
}
|
50
|
|
51
|
?>
|