#!/bin/sh #------------------------------------------------------------------------------ # /usr/local/htdocs/spaceinfo.cgi - space information # # Copyright (c) 2003-2010 Marcus Herleb, info(at)herleb(dot).de # Copyright (c) 2011-2024 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2003-10-11 mgh # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version.. #------------------------------------------------------------------------------ # get kernel version KV=${KV="`cat /proc/sys/kernel/osrelease`"} echo "Content-Type: text/html; charset=iso-8859-1" echo "Cache-control: no-store" # HTTP/1.1 (or no-cache?) echo "Pragma: no-cache" # HTTP/1.0 echo "Expires: `date -Ru`" # Expires now! echo "Refresh: 30" echo echo "
" echo "" echo "$b KB RAM free | Swap $swp | Swap $swp | " else if [ $a = "MemFree:" ] then echo "$b KB RAM free | " # echo $b > /../../tmp/mem.tmp fi if [ $a = "SwapTotal:" -a $a = "0" ] then swp="not used" tdbg="#e9e9e9" fi fi done < meminfo.txt fi fi echo "
MOUNTPOINT | " echo "BELEGT | " echo "FREI | " echo "
$(echo $dd | cut -d" " -f$a) | " # Mountpoint b=4 b=`expr $b + $i` belegt=$(echo $dd | cut -d" " -f$b | cut -d "%" -f1) c=1 c=`expr $c + $i` d=3 d=`expr $d + $i` if [ "$belegt" -le "19" ] then echo "$belegt % | of $(echo $dd | cut -d" " -f$c) | $(echo $dd | cut -d" " -f$d) | " fi if [ "$belegt" -le "50" -a "$belegt" -ge "20" ] then echo "$belegt % of | $(echo $dd | cut -d" " -f$c) | $(echo $dd | cut -d" " -f$d) | " fi if [ "$belegt" -le "69" -a "$belegt" -ge "51" ] then echo "$belegt % of $(echo $dd | cut -d" " -f$c) | $(echo $dd | cut -d" " -f$d) | " fi if [ "$belegt" -ge "70" -a "$belegt" -le "84" ] then bgb=#ccccff bgc=yellow echo "$belegt % of $(echo $dd | cut -d" " -f$c) | $(echo $dd | cut -d" " -f$d) | " fi if [ "$belegt" -ge "85" -a "$belegt" -le "100" ] then bgb=#ff6699 bgc=red echo "$belegt % of $(echo $dd | cut -d" " -f$c) | $(echo $dd | cut -d" " -f$d) | " fi i=`expr $i + 5` echo "