]> WPIA git - gigi.git/blobdiff - doc/jenkinsJob/dyn-txt.php
ADD: output pinglog, test DNS and email ping.
[gigi.git] / doc / jenkinsJob / dyn-txt.php
diff --git a/doc/jenkinsJob/dyn-txt.php b/doc/jenkinsJob/dyn-txt.php
new file mode 100644 (file)
index 0000000..c7c73e4
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+header("Content-type: text/plain");
+
+if($_GET['token'] != "<here a secure password>"){
+       die ();
+}
+$t1 = $_GET['t1'];
+$t2 = $_GET['t2'];
+if(!preg_match("/[a-zA-Z0-9]+/", $t1) || !preg_match("/[a-zA-Z0-9]+/", $t2)){
+  die("Error");
+}
+
+$call = <<<EOF
+server localhost
+update delete cacert-{$t1}.<your fakezone here> TXT
+update add cacert-{$t1}.<your fakezone here>  60 TXT {$t2}
+send
+quit
+
+EOF;
+echo $call;
+
+$nsupdate = popen("/usr/bin/nsupdate -k <here your dnssec key>.key", 'w');
+fwrite($nsupdate, $call);
+$retval = pclose($nsupdate); // nsupdate doesn't return anything useful when called this way
+
+?>