Revision ffdcbeb6
Added by Jim Pingle about 14 years ago
usr/local/www/status_dhcpv6_leases.php | ||
---|---|---|
110 | 110 |
} |
111 | 111 |
|
112 | 112 |
$awk = "/usr/bin/awk"; |
113 |
|
|
113 | 114 |
/* this pattern sticks comments into a single array item */ |
114 |
$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
|
|
115 |
$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";\", \"\"); print;}'";
|
|
115 | 116 |
/* We then split the leases file by } */ |
116 | 117 |
$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'"; |
117 | 118 |
|
... | ... | |
165 | 166 |
case "ia-na": |
166 | 167 |
if ($data[$f+1][0] == '"') { |
167 | 168 |
$duid = ""; |
169 |
/* FIXME: This needs a safety belt to prevent an infinite loop */ |
|
168 | 170 |
while ($data[$f][strlen($data[$f])-1] != '"') { |
169 | 171 |
$duid .= " " . $data[$f+1]; |
170 | 172 |
$f++; |
Also available in: Unified diff
Also ignore lines starting with server-duid, and fix the # ignore so it is anchored on the start of the line. Add a note to fix a loop later that can fall into infinity.