diff --git a/bin/dfwatch b/bin/dfwatch index a5764fc9e05d1eee9b83633e4d26055c4851428e..36922c21ee8593b6b4a29184e1ef6f4f110a046b 100755 --- a/bin/dfwatch +++ b/bin/dfwatch @@ -2,6 +2,10 @@ DFFILT="-x tmpfs -x devtmpfs -l" FSFILT='\(/mnt/xstill\)' +MAIL=mail +if ! which $MAIL >&/dev/null; then + MAIL=bsd-mailx +fi FULL=$(df --output=pcent,avail,target,size $DFFILT | tail -n+2 | sed -e 's/^[ ]*//' -e 's/[ ][ ]*/,/g' | while read e; do PRC=$(echo $e | cut -f1 -d, | sed 's/%//') @@ -26,6 +30,6 @@ FULL=$(df --output=pcent,avail,target,size $DFFILT | tail -n+2 | sed -e 's/^[ ]* done) if test -n "$FULL"; then - df -h $DFFILT | mail -s "[DF:$(hostname)] Full: $FULL" xstill@fi.muni.cz + df -h $DFFILT | $MAIL -s "[DF:$(hostname)] Full: $FULL" xstill@fi.muni.cz exit 1 fi