blob: 404de375ee515959ff15fc320507c9a320fbcb3e (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ª/bin/bash
source /tmp/net-eth0.conf
FILEINFOHTML=$OGLOG/`ogGetIpAddress`.info.html
FILEINFOCACHE=$OGLOG/`ogGetIpAddress`.cache.txt
ogMountCache 2>/dev/null
CACHECONTENIDO=`ls -m $OGCAC/$OGIMG 2>/dev/null`
SPEED=$(LANG=C ethtool $DEVICE 2>/dev/null | awk '$1~/Speed/ {print $2}')
case "$SPEED" in
1000[Mm]b/s) ;;
100[Mm]b/s) SPEED="<font color=\"blue\">$SPEED</font>" ;;
10[Mm]b/s) SPEED="<font color=\"grey\">$SPEED</font>" ;;
*) SPEED="<font color=\"red\">$SPEED</font>" ;;
esac
DUPLEX=$(LANG=C ethtool $DEVICE 2>/dev/null | awk '$1~/Duplex/ {print $2}')
case "$DUPLEX" in
[Ff]ull) ;;
*) DUPLEX="<font color=\"red\">$DUPLEX</font>"
esac
CACHESIZEFREE=$(ogGetFreeSize `ogFindCache`)
expr $CACHESIZEFREE / 1024 > $FILEINFOCACHE 2>/dev/null && echo '.MB,' >> $FILEINFOCACHE
#
# echo '';
#
cat > $FILEINFOHTML << EOF
<div align="center" style="font-family: Arial, Helvetica, sans-serif;">
<p style="color:#999999; font-size: 16px; margin: 2em;">
<table border=1 width="100%">
<tr>
<td rowspan="2"><p align="left"><img border="0" src="../images/iconos/logoopengnsys.png"><p> </td>
<td> Hostname </td> <td> IP </td> <td> MAC </td> <td> Speed </td> <td> Duplex </td> </tr>
<tr> <td>$HOSTNAME </td> <td> $(ogGetIpAddress) </td> <td> $(ogGetMacAddress) </td> <td> $SPEED </td> <td> $DUPLEX </td> </tr>
</table>
</p>
<p style="font-size: 14px; margin: 2em;">
</p>
</div>
EOF
cat >> $FILEINFOCACHE << EOF
$CACHECONTENIDO
EOF
|