[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/sbin/ -> df.sh (source)

   1  #!/bin/bash
   2  
   3  #
   4  ## $Id: df.sh 7588 2012-12-30 00:28:37Z keyser $ ##
   5  #
   6  ##### Retourne la commande df au format HTML #####
   7  #
   8  
   9  if [ "$1" = "--help" -o "$1" = "-h" ]
  10  then
  11      echo "Retourne la commande df au format HTML"
  12      echo "Usage : aucune option"
  13      exit
  14  fi    
  15  
  16  # Etat ement d'un utilisateur
  17  # Olivier LECLUSE 03 10 1999
  18  cat <<EOF
  19  <DIV ALIGN="CENTER">
  20  <H1>Espace libre sur le disque</H1>
  21  </DIV> <BR>
  22  <TABLE WIDTH="80%" ALIGN="CENTER" BORDER="1">
  23  EOF
  24  
  25  titre="1"
  26  df -l -P -x tmpfs | while true
  27  do
  28      read ligne
  29      if [ "$ligne" = "" ]; then
  30          break
  31      fi
  32      set -- $ligne
  33      if [ "$titre" = "1" ]; then
  34          echo "<TR><TD ALIGN='CENTER'><STRONG>Partition</STRONG></TD>"
  35          echo "<TD ALIGN='CENTER'><STRONG>Point de montage</STRONG></TD>"
  36          echo "<TD ALIGN='CENTER'><STRONG>Espace total(Mo)</STRONG></TD>"
  37          echo "<TD ALIGN='CENTER'><STRONG>Espace occup&#233; (Mo)</STRONG></TD>"
  38          echo "<TD ALIGN='CENTER'><STRONG>Espace libre (Mo)</STRONG></TD>"
  39          echo "<TD ALIGN='CENTER'><STRONG>Poucentage occup&#233;</STRONG></TD></TR>"
  40          titre=""
  41      else
  42          occ=`echo $5|cut -d% -f1`
  43          color="#33FF33"
  44          if [ $occ -ge 75 ]; then color="#Fcb000"; fi
  45          if [ $occ -ge 90 ]; then color="#FF3333"; fi
  46          echo "<TR><TD>"
  47          echo $1; echo "</TD><TD ALIGN='CENTER' BGCOLOR=$color>"
  48          echo $6; echo "</TD><TD ALIGN='CENTER' BGCOLOR=$color>"
  49          let total=$2/1024
  50          echo $total; echo "</TD><TD ALIGN='CENTER' BGCOLOR=$color>"
  51          let total=$3/1024
  52          echo $total; echo "</TD><TD ALIGN='CENTER' BGCOLOR=$color>"
  53          let total=$4/1024
  54          echo $total; echo "</TD><TD ALIGN='CENTER' BGCOLOR=$color>"
  55          echo "$occ %"; echo "</TD></TR>"
  56      fi
  57  done
  58  cat <<EOF
  59  </TABLE>
  60  EOF


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1