Project

General

Profile

Download (1.33 KB) Statistics
| Branch: | Tag: | Revision:
1 cb7d18d5 Renato Botelho
#!/usr/local/bin/php-cgi -f
2 514123f8 Ermal
<?php
3
/*
4 ac24dc24 Renato Botelho
 * rc.dyndns.update
5
 *
6
 * part of pfSense (https://www.pfsense.org)
7 b8f91b7c Luiz Souza
 * Copyright (c) 2004-2018 Rubicon Communications, LLC (Netgate)
8 ac24dc24 Renato Botelho
 * All rights reserved.
9
 *
10 b12ea3fb Renato Botelho
 * Licensed under the Apache License, Version 2.0 (the "License");
11
 * you may not use this file except in compliance with the License.
12
 * You may obtain a copy of the License at
13 ac24dc24 Renato Botelho
 *
14 b12ea3fb Renato Botelho
 * http://www.apache.org/licenses/LICENSE-2.0
15 ac24dc24 Renato Botelho
 *
16 b12ea3fb Renato Botelho
 * Unless required by applicable law or agreed to in writing, software
17
 * distributed under the License is distributed on an "AS IS" BASIS,
18
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
 * See the License for the specific language governing permissions and
20
 * limitations under the License.
21 ac24dc24 Renato Botelho
 */
22 514123f8 Ermal
23
require_once("config.inc");
24 afa32fcc Ermal
require_once("gwlb.inc");
25 514123f8 Ermal
require_once("functions.inc");
26
require_once("filter.inc");
27
require_once("shaper.inc");
28
29
/* Interface IP address has changed */
30
31 e173dd74 Phil Davis
if (isset($_GET['dyndns'])) {
32 c71b14fd Ermal
	$argument = $_GET['dyndns'];
33 e173dd74 Phil Davis
} else {
34 c71b14fd Ermal
	$argument = trim($argv[1], " \n");
35 e173dd74 Phil Davis
}
36 514123f8 Ermal
37 e173dd74 Phil Davis
if (empty($argument) || $argument == "all") {
38 514123f8 Ermal
	services_dyndns_configure();
39
	services_dnsupdate_process();
40
} else {
41 155362f7 Ermal
	$interface = lookup_gateway_interface_by_name($argument);
42 e173dd74 Phil Davis
	if (empty($interface)) {
43 155362f7 Ermal
		$interface = $argument;
44 e173dd74 Phil Davis
	}
45 155362f7 Ermal
	services_dyndns_configure($interface);
46
	services_dnsupdate_process($interface);
47 514123f8 Ermal
}
48
49
?>