Need help with if [ ] in my script?

In the following sccript I want to be able to only send different notifications based in whether the filesyste is over 80% or 90%. I need help with if [ ]. How would I make it so that if a filesystem was over 80% but less than 90% only do one thing. The way I currently have it setup I end up getting double notifications when a filesystem is over 90%.

#!/bin/bash

host=`uname -n`
NOTIFYEMAIL="joe.blow@me.com"
NOTIFYPAGE="joe.blow@me.com"

# Notification message
root_msg="FileSystem `df -h / | tail -1 | awk '{print $1 " is " $5 " Utilized Mounted on " $6 " with a Size of " $2 " has Used " $3 " Leaving only " $4 " of Available Space. "}'`"

# Set Severity level
sev1_Alarm="mailx -s $host $NOTIFYPAGE $NOTIFYEMAIL"
sev2_Warn="mailx -s $host $NOTIFYEMAIL"

# Extract filesystem % full integer
rootuse=`df -h / | awk '{print $5}' | cut -c1-2 | grep '[0-9]'`

# / filesystem
if [ "$rootuse" -gt "80" ]
then
echo $root_msg | $sev2_Warn
if [ "$rootuse" -gt "90" ]
then
echo $root_msg | $sev1_Alarm
fi
fi

I don't use bash but it should work with &&

something like (this was from a csh script):
if ($sq[1] == "2" && $sq[2] == "2" && $sq[3] == "2") then

Maybe I don't understand the concept of your example. Can you explain the [1] [2] [3] in your example and how it correalates to the 80 & 90?

Would it go something like this?

if ($rootuse[1] == "2" && $rootuse[2] == "2" && $rootuse[3] == "2")

This is the idea I had in my head I just don't know how to make it work. I know this is obviously syntactically incorrect but it makes more sense to me.

if [ "$rootuse" -gt "80" & less than "90"] then
echo $sev2_Warn
if [ "$rootuse" -gt "80" & -gt "90"] then
echo $sev1_Alarm
fi
fi

First, your if-statement needs an "else" to make it do only one action at most. And of course you want that one action to be the most severe, so check for gt 90 first:

if [ "$rootuse" -gt 90 ]
then
   echo $root_msg | $sev1_Alarm
else
   if [ "$rootuse" -gt 80 ]
      then
         echo $root_msg | $sev2_Warn
   fi
fi

Also, = and != are for strings, and -gt -lt -eq etc are numeric tests, so I use 90 instead of "90".

And when you pull % full, your cut gets only 2 digits because you want to leave the %-sign behind. But when it hits 100, your code will pull only 10 instead of 100. I can suggest the following code instead, which pipes into only awk and avoids 2nd and 3rd pipe:

rootuse=`df -h / | awk 'BEGIN{getline}{print substr($5,1,length($5)-1)}'`

You wrote:
Maybe I don't understand the concept of your example. Can you explain the [1] [2] [3] in your example and how it correalates to the 80 & 90?

Would it go something like this?

if ($rootuse[1] == "2" && $rootuse[2] == "2" && $rootuse[3] == "2")

It's an example of having multiple statements - each has to be true for the "if (true) then command" to work. Like I wrote - I don't use bash and this was only an example - you can change it to use less than, equal, greater than... It was the && you needed for yours. Jimbo put you on the correct track.

I didn't even think about accounting for a filesystem that reaches 100%. I used your suggestions and it is working great. Excellent suggestions Jimbo.

Ahh.... now I understand your example with the multiple statements, hoghunter. Thanks for the feedback.