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