Revision 2675
Added by Matt Jones about 19 years ago
src/perl/control-services/control-services.pl | ||
---|---|---|
40 | 40 |
$| = 1; |
41 | 41 |
|
42 | 42 |
# run the main routine |
43 |
#&testddns; |
|
44 |
#print &acknowledgeAlert("223456", "Foo is good"); |
|
45 | 43 |
&updateDns; |
46 | 44 |
|
47 | 45 |
# When a service becomes unavailable make a DNS change that will take |
... | ... | |
141 | 139 |
close(LOG); |
142 | 140 |
} |
143 | 141 |
|
144 |
# test routine to see if DNS update using DDNS is working |
|
145 |
sub testddns { |
|
146 |
my $zone = $main::zones[0]; |
|
147 |
my $class = $main::classes[0]; |
|
148 |
my $ttl = $main::default_ttl; |
|
149 |
my $type = $main::types[0]; |
|
150 |
my $message = ''; |
|
151 |
my $success = 1; |
|
152 |
|
|
153 |
# Add a record |
|
154 |
$ttl = '60'; |
|
155 |
$type = 'A'; |
|
156 |
my $host = 'testhost'; |
|
157 |
my $ip = '24.237.20.95'; |
|
158 |
($success,$message) = &add_records($zone, $class, $host, $ttl, $type, $ip); |
|
159 |
debug("Add records success: " . $success); |
|
160 |
debug("Add records message: " . $message); |
|
161 |
|
|
162 |
# Delete a record |
|
163 |
my $record = "$host.$zone"; |
|
164 |
my @rr = ($record); |
|
165 |
($success,$message) = &del_records($zone,$class,@rr); |
|
166 |
debug("Del records success: " . $success); |
|
167 |
debug("Del records message: " . $message); |
|
168 |
} |
|
169 |
|
|
170 | 142 |
# Get a resolver to be used for DDNS updates |
171 | 143 |
sub get_resolver { |
172 | 144 |
my ($tsig_keyname,$tsig_key) = @_; |
Also available in: Unified diff
Removed unused subroutines that were for testing.