Revision 30fb0527
Added by Ermal LUÇI about 13 years ago
etc/rc.newdynamicdns | ||
---|---|---|
1 |
#!/usr/local/bin/php -f |
|
2 |
<?php |
|
3 |
/* |
|
4 |
$Id$ |
|
5 |
part of m0n0wall (http://m0n0.ch/wall) |
|
6 |
|
|
7 |
Copyright (C) 2007 Manuel Kasper <mk@neon1.net>. |
|
8 |
Copyright (C) 2009 Seth Mos <seth.mos@dds.nl>. |
|
9 |
All rights reserved. |
|
10 |
|
|
11 |
Redistribution and use in source and binary forms, with or without |
|
12 |
modification, are permitted provided that the following conditions are met: |
|
13 |
|
|
14 |
1. Redistributions of source code must retain the above copyright notice, |
|
15 |
this list of conditions and the following disclaimer. |
|
16 |
|
|
17 |
2. Redistributions in binary form must reproduce the above copyright |
|
18 |
notice, this list of conditions and the following disclaimer in the |
|
19 |
documentation and/or other materials provided with the distribution. |
|
20 |
|
|
21 |
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
|
22 |
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
23 |
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
24 |
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
|
25 |
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
26 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
27 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
28 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
29 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
30 |
POSSIBILITY OF SUCH DAMAGE. |
|
31 |
*/ |
|
32 |
|
|
33 |
/* parse the configuration and include all functions used below */ |
|
34 |
require_once("config.inc"); |
|
35 |
require_once("services.inc"); |
|
36 |
require_once("functions.inc"); |
|
37 |
require_once("filter.inc"); |
|
38 |
|
|
39 |
/* make sure to wait until the boot scripts have finished */ |
|
40 |
while (file_exists("{$g['varrun_path']}/booting")) { |
|
41 |
sleep(1); |
|
42 |
} |
|
43 |
$dynamicdnslck = lock('dynamicdns', LOCK_EX); |
|
44 |
|
|
45 |
if(count($config['dyndnses']['dyndns']) > 0) |
|
46 |
log_error("DynDns: One or more Dynamic DNS endpoints has changed its IP. Refreshing."); |
|
47 |
/* if the monitor interface is set to a gateway group we will update the IP */ |
|
48 |
|
|
49 |
/* perform RFC 2136 DNS update */ |
|
50 |
services_dnsupdate_process($interface); |
|
51 |
|
|
52 |
/* signal dyndns update */ |
|
53 |
services_dyndns_configure($interface); |
|
54 |
|
|
55 |
filter_configure(); |
|
56 |
|
|
57 |
unlock($dynamicdnslck); |
|
58 |
?> |
Also available in: Unified diff
Surely this cannot work a fit
Revert "This script update the Dynamic DNS registration when called by apinger if a gateway from a group is down."
This reverts commit b013b81e5de0a57572bba13167c8182c8a0d5c5a.