Skip to content

Commit

Permalink
added capability to ignore mount points
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclingzealot committed Aug 29, 2016
1 parent 97b1dd9 commit 4d1900d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lowDiskSpace.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ formerDir=`pwd`
# http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash

#Set the config file
configFile="$HOME/.${__base}.conf"
configFile="$HOME/.${__base}.ignoreMountPoints.conf"

#=== END Unique instance ============================================

Expand All @@ -63,10 +63,10 @@ chmod 600 $log


#Check that the config file exists
#if [[ ! -f "$configFile" ]] ; then
# echo "I need a file at $configFile with an email address to warn"
# exit 1
#fi
if [[ ! -f "$configFile" ]] ; then
echo "I need a file at $configFile with a list of mountpoints to ignore"
exit 1
fi

export DISPLAY=:0

Expand All @@ -91,6 +91,10 @@ IFS=$'\n'; for mount in `df`; do
filesystem=$(echo $mount | awk '{ print $1}' | sed 's/%//g')
THRESHOLD=90

if grep "^${mountPoint}$" $configFile ; then
continue
fi

if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
sendAlert=1
body=`echo -e "${body}
Expand Down

0 comments on commit 4d1900d

Please sign in to comment.