Junk

Junk Commit Details

Date:2018-10-12 12:20:11 (1 year 1 month ago)
Author:Nicola Fontana
Branch:master
Commit:a15161a062ddfda58af270669242f6954f62345e
Parents: f78a274564f6935424cf03f233498cf1a84f714a
Message:parsedns: first implementation

Changes:
Amisc/parsedns.php (full)

File differences

misc/parsedns.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/* Used to backup DNS entries from aziendeitalia.com that, AFAIK, does
* not have a damned export in the domain page.
*
* The data is expected to be fetched by the following command executed
* in the javascript console of the DNS manager page:
*
* $("input, textarea, select").serialize();
*
* After that, you should copy the result into a new file and pipe it to
* the this script, e.g.:
*
* cat pasted-result | php parsedns.php
*/
$line = fgets(STDIN);
$data = array();
parse_str($line, $data);
$data = $data['record'];
foreach ($data as $record) {
extract($record);
echo str_pad($name, 30);
echo str_pad($type, 10);
echo str_pad($ttl, 10);
echo reset($field), "\n";
}

Archive Download the corresponding diff file

Branches