Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | Revision:
1 cb7d18d5 Renato Botelho
#!/usr/local/bin/php-cgi -f
2 514123f8 Ermal
<?php
3
/*
4 e173dd74 Phil Davis
	rc.dyndns.update
5
	part of pfSense (https://www.pfsense.org)
6
	Copyright (C) 2004 Scott Ullrich
7
	All rights reserved.
8
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29 514123f8 Ermal
*/
30
31
require_once("config.inc");
32 afa32fcc Ermal
require_once("gwlb.inc");
33 514123f8 Ermal
require_once("functions.inc");
34
require_once("filter.inc");
35
require_once("shaper.inc");
36
37
/* Interface IP address has changed */
38
39 e173dd74 Phil Davis
if (isset($_GET['dyndns'])) {
40 c71b14fd Ermal
	$argument = $_GET['dyndns'];
41 e173dd74 Phil Davis
} else {
42 c71b14fd Ermal
	$argument = trim($argv[1], " \n");
43 e173dd74 Phil Davis
}
44 514123f8 Ermal
45 e173dd74 Phil Davis
if (empty($argument) || $argument == "all") {
46 514123f8 Ermal
	services_dyndns_configure();
47
	services_dnsupdate_process();
48
} else {
49 155362f7 Ermal
	$interface = lookup_gateway_interface_by_name($argument);
50 e173dd74 Phil Davis
	if (empty($interface)) {
51 155362f7 Ermal
		$interface = $argument;
52 e173dd74 Phil Davis
	}
53 155362f7 Ermal
	services_dyndns_configure($interface);
54
	services_dnsupdate_process($interface);
55 514123f8 Ermal
}
56
57
?>