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