remove the crappy firewall page - no time to get it fixed before rc6
[openwrt/svn-archive/archive.git] / openwrt / package / webif / files / www / cgi-bin / webif / leases.sh
1 #!/usr/bin/webif-page
2 <?
3 . /usr/lib/webif/webif.sh
4 header "Status" "DHCP" "@TR<<DHCP leases>>"
5 ?>
6 <table style="width: 90%; text-align: left;" border="0" cellpadding="2" cellspacing="2" align="center">
7 <tbody>
8 <tr>
9 <th>@TR<<MAC Address>></th>
10 <th>@TR<<IP Address>></th>
11 <th>@TR<<Name>></th>
12 <th>@TR<<Expires in>></th>
13 </tr>
14 <? [ -e /tmp/dhcp.leases ] && awk -vdate="$(date +%s)" '
15 $1 > 0 {
16 print "<tr>"
17 print "<td>" $2 "</td>"
18 print "<td>" $3 "</td>"
19 print "<td>" $4 "</td>"
20 print "<td>"
21 t = $1 - date
22 h = int(t / 60 / 60)
23 if (h > 0) printf h "h "
24 m = int(t / 60 % 60)
25 if (m > 0) printf m "min "
26 s = int(t % 60)
27 printf s "sec "
28 printf "</td>"
29 print "</tr>"
30 }
31 ' /tmp/dhcp.leases ?>
32 </tbody>
33 </table>
34
35 <? footer ?>
36 <!--
37 ##WEBIF:name:Status:2:DHCP
38 -->