Skip to content
Snippets Groups Projects
Commit d00a100a authored by root's avatar root
Browse files

Fix dfwatch on Debian (no mail)

parent 97e5e429
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
DFFILT="-x tmpfs -x devtmpfs -l" DFFILT="-x tmpfs -x devtmpfs -l"
FSFILT='\(/mnt/xstill\)' 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 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/%//') 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/^[ ]* ...@@ -26,6 +30,6 @@ FULL=$(df --output=pcent,avail,target,size $DFFILT | tail -n+2 | sed -e 's/^[ ]*
done) done)
if test -n "$FULL"; then 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 exit 1
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment