source: client/shared/scripts/generateMenuDefault @ 794d2f0

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
Last change on this file since 794d2f0 was 1663c67, checked in by ramon <ramongomez@…>, 13 years ago

#411: Usar interfaz detectada en script generateMenuDefault

git-svn-id: https://opengnsys.es/svn/branches/version1.0@3265 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#ª/bin/bash
2
3DEVICE=${DEVICE:-"eth0"}
4source /tmp/net-$DEVICE.conf
5FILEINFOHTML=$OGLOG/`ogGetIpAddress`.info.html
6FILEINFOCACHE=$OGLOG/`ogGetIpAddress`.cache.txt
7ogMountCache 2>/dev/null
8CACHECONTENIDO=`ls -m $OGCAC/$OGIMG 2>/dev/null`
9
10SPEED=$(LANG=C ethtool $DEVICE 2>/dev/null | awk '$1~/Speed/ {print $2}')
11case "$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>" ;;
16esac
17DUPLEX=$(LANG=C ethtool $DEVICE 2>/dev/null | awk '$1~/Duplex/ {print $2}')
18case "$DUPLEX" in
19        [Ff]ull)        ;;
20        *)              DUPLEX="<font color=\"red\">$DUPLEX</font>"
21esac
22CACHESIZEFREE=$(ogGetFreeSize `ogFindCache`)
23expr $CACHESIZEFREE / 1024 > $FILEINFOCACHE 2>/dev/null && echo '.MB,' >> $FILEINFOCACHE
24
25#
26#  echo '';
27#
28
29cat > $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
45EOF
46cat >> $FILEINFOCACHE << EOF
47$CACHECONTENIDO
48EOF
49
Note: See TracBrowser for help on using the repository browser.