We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b468795 commit 8696f01Copy full SHA for 8696f01
1 file changed
disk-usage.sh
@@ -6,11 +6,10 @@
6
# http://www.cyberciti.biz/faq/mac-osx-unix-get-an-alert-when-my-disk-is-full/
7
8
check() {
9
- FS="$1"
10
- OUTPUT=($(LC_ALL=C df -P ${FS}))
11
- CURRENT=$(echo ${OUTPUT[11]} | sed 's/%//')
12
- [ $CURRENT -gt $threshold ] && \
13
- echo "$FS: file system usage at $CURRENT%" && \
+ FS=$1
+ CURRENT=$(df -P "$FS" | tail -n1 | awk '{print $5}' | sed 's/%//')
+ test "$CURRENT" -gt "$threshold" &&
+ echo "$FS: file system usage at $CURRENT%" &&
14
return 1
15
return 0
16
}
0 commit comments