918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Line | |
---|
1 | #ª/bin/bash |
---|
2 | |
---|
3 | DEVICE=${DEVICE:-"eth0"} |
---|
4 | source /tmp/net-$DEVICE.conf |
---|
5 | FILEINFOHTML=$OGLOG/`ogGetIpAddress`.info.html |
---|
6 | FILEINFOCACHE=$OGLOG/`ogGetIpAddress`.cache.txt |
---|
7 | ogMountCache 2>/dev/null |
---|
8 | CACHECONTENIDO=`ls -m $OGCAC/$OGIMG 2>/dev/null` |
---|
9 | |
---|
10 | SPEED=$(LANG=C ethtool $DEVICE 2>/dev/null | awk '$1~/Speed/ {print $2}') |
---|
11 | case "$SPEED" in |
---|
12 | 1000[Mm]b/s) ;; |
---|
13 | 100[Mm]b/s) SPEED="<font color=\"blue\">$SPEED</font>" ;; |
---|
14 | 10[Mm]b/s) SPEED="<font color=\"grey\">$SPEED</font>" ;; |
---|
15 | *) SPEED="<font color=\"red\">$SPEED</font>" ;; |
---|
16 | esac |
---|
17 | DUPLEX=$(LANG=C ethtool $DEVICE 2>/dev/null | awk '$1~/Duplex/ {print $2}') |
---|
18 | case "$DUPLEX" in |
---|
19 | [Ff]ull) ;; |
---|
20 | *) DUPLEX="<font color=\"red\">$DUPLEX</font>" |
---|
21 | esac |
---|
22 | CACHESIZEFREE=$(ogGetFreeSize `ogFindCache`) |
---|
23 | expr $CACHESIZEFREE / 1024 > $FILEINFOCACHE 2>/dev/null && echo '.MB,' >> $FILEINFOCACHE |
---|
24 | |
---|
25 | # |
---|
26 | # echo ''; |
---|
27 | # |
---|
28 | |
---|
29 | cat > $FILEINFOHTML << EOF |
---|
30 | <div align="center" style="font-family: Arial, Helvetica, sans-serif;"> |
---|
31 | <p style="color:#999999; font-size: 16px; margin: 2em;"> |
---|
32 | |
---|
33 | <table border=1 width="100%"> |
---|
34 | <tr> |
---|
35 | <td rowspan="2"><p align="left"><img border="0" src="../images/iconos/logoopengnsys.png"><p> </td> |
---|
36 | <td> Hostname </td> <td> IP </td> <td> MAC </td> <td> Speed </td> <td> Duplex </td> </tr> |
---|
37 | <tr> <td>$HOSTNAME </td> <td> $(ogGetIpAddress) </td> <td> $(ogGetMacAddress) </td> <td> $SPEED </td> <td> $DUPLEX </td> </tr> |
---|
38 | </table> |
---|
39 | |
---|
40 | </p> |
---|
41 | <p style="font-size: 14px; margin: 2em;"> |
---|
42 | </p> |
---|
43 | </div> |
---|
44 | |
---|
45 | EOF |
---|
46 | cat >> $FILEINFOCACHE << EOF |
---|
47 | $CACHECONTENIDO |
---|
48 | EOF |
---|
49 | |
---|
Note: See
TracBrowser
for help on using the repository browser.