#!/bin/bash

# Disk to check (taken as a parameter)
DISK=$1

# warning level (as a percentage, parameter 2)
WARNINGLEVEL=$2

# location of df
DFLOCATION="df"

set `$DFLOCATION -h | grep $DISK`
USAGE=`echo -n $5 | sed -e s/%//`

if [ $USAGE -gt $WARNINGLEVEL ]
then
 echo "DISK FULL"
 exit 1
else
 exit 0
fi

