diff options
Diffstat (limited to 'client/shared/scripts/generateMenuDefault')
-rwxr-xr-x | client/shared/scripts/generateMenuDefault | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/client/shared/scripts/generateMenuDefault b/client/shared/scripts/generateMenuDefault index 0437cd3d..404de375 100755 --- a/client/shared/scripts/generateMenuDefault +++ b/client/shared/scripts/generateMenuDefault @@ -1,30 +1,48 @@ #ยช/bin/bash source /tmp/net-eth0.conf -FILEINFOHTML=/opt/opengnsys/log/`ogGetIpAddress`.info.html - -SPEED=$(ethtool $DEVICE | grep Speed | awk -F": " '{print $2}') -DUPLEX=$(ethtool $DEVICE | grep Duplex | awk -F": " '{print $2}') +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;">' +<div align="center" style="font-family: Arial, Helvetica, sans-serif;"> <p style="color:#999999; font-size: 16px; margin: 2em;"> -<table border=1> -<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 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
\ No newline at end of file +EOF +cat >> $FILEINFOCACHE << EOF +$CACHECONTENIDO +EOF + |