]> WPIA git - gigi.git/blob - doc/jenkinsJob/dyn-txt.php
ADD: output pinglog, test DNS and email ping.
[gigi.git] / doc / jenkinsJob / dyn-txt.php
1 <?php
2 header("Content-type: text/plain");
3
4 if($_GET['token'] != "<here a secure password>"){
5         die ();
6 }
7 $t1 = $_GET['t1'];
8 $t2 = $_GET['t2'];
9 if(!preg_match("/[a-zA-Z0-9]+/", $t1) || !preg_match("/[a-zA-Z0-9]+/", $t2)){
10   die("Error");
11 }
12
13 $call = <<<EOF
14 server localhost
15 update delete cacert-{$t1}.<your fakezone here> TXT
16 update add cacert-{$t1}.<your fakezone here>  60 TXT {$t2}
17 send
18 quit
19
20 EOF;
21 echo $call;
22
23 $nsupdate = popen("/usr/bin/nsupdate -k <here your dnssec key>.key", 'w');
24 fwrite($nsupdate, $call);
25 $retval = pclose($nsupdate); // nsupdate doesn't return anything useful when called this way
26
27 ?>