[services-cvs] CVS services/etc/misc
CVS User miham
root at tempel.bibl.u-szeged.hu
2004. Nov. 18., Cs, 17:01:38 CET
Update of /var/lib/cvs/services/etc/misc
In directory tempel:/tmp/cvs-serv21690/misc
Added Files:
hehe.php hihi.php
Log Message:
Some tool for generate geplista.m4 and geplista.txt
--- /var/lib/cvs/services/etc/misc/hehe.php 2004/11/18 16:01:38 NONE
+++ /var/lib/cvs/services/etc/misc/hehe.php 2004/11/18 16:01:38 1.1
#!/usr/bin/php4 -q
<?
$data = @file('geplista.pre');
$factserial = array("CZC", "419", "07");
foreach ($data as $line) {
$actdata = explode(" ", trim($line));
$num = array_shift($actdata);
$mac = array();
for ($i = 0; $i < 6; $i++) {
array_unshift($mac, array_pop($actdata));
}
while (sizeof($actdata) < 4) {
array_unshift($actdata, $factserial[3 - sizeof($actdata)]);
}
$serial = implode(' ', $actdata);
$macstr = implode(":", $mac);
echo "{$num}\t{$serial}\t{$macstr}\n";
}
?>
--- /var/lib/cvs/services/etc/misc/hihi.php 2004/11/18 16:01:38 NONE
+++ /var/lib/cvs/services/etc/misc/hihi.php 2004/11/18 16:01:38 1.1
#!/usr/bin/php4 -q
<?
$data1 = @file('geplista.m4');
$data2 = @file('geplista.txt');
$gepstruct = array();
foreach ($data2 as $actline) {
$actgep = explode("\t", rtrim($actline));
$actstruct = array();
$actstruct["num"] = array_shift($actgep);
$actstruct["sn"] = array_shift($actgep);
$actstruct["mac"] = array_shift($actgep);
$actstruct["port"] = array_shift($actgep);
$actstruct["ren"] = "R4";
$gepstruct['"' . $actstruct["port"] . '"'] = $actstruct;
}
$res = array();
foreach ($data1 as $actline) {
if (substr($actline,0,10) == 'ujGEPentry') {
$actdata = substr($actline, 11, -4);
$actdarr = explode(',', $actdata);
if (substr($actdarr[5], 1, -1) == "R4") {
if (isset($gepstruct[$actdarr[6]])) {
$dataused = $gepstruct[$actdarr[6]];
$actdarr[0] = $dataused["mac"];
$actdarr[1] = '"' . $dataused["sn"] . '"';
$actdarr[9] = '"User"';
$actdarr[10] = '"pc' . $dataused["num"] . '"';
$actdarr[11] = '"cab"';
$actdarr[12] = "160.114.158." . (intval($dataused["num"]) + 10);
$actline = "ujGEPentry(" . implode(",", $actdarr) . ")dnl\n";
}
}
}
# $res[] = $actline;
echo $actline;
}
?>
További információk a(z) Services-cvs levelezőlistáról