Skip to content

Commit

Permalink
Create dfa
Browse files Browse the repository at this point in the history
  • Loading branch information
SDRausty authored Jan 25, 2018
1 parent 3e55b5a commit a42d362
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/frags/dfa
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# From http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_03.html
# Regarding https://github.com/sdrausty/TermuxArch/issues/37
# This script does a very simple test for checking disk space.

space=`df -h | awk '{print $5}' | grep % | grep -v Use | sort -n | tail -1 | cut -d "%" -f1 -`

case $space in
[1-6]*)
Message="All is quiet."
;;
[7-8]*)
Message="Start thinking about cleaning out some stuff. There's a partition that is $space % full."
;;
9[1-8])
Message="Better hurry with that new disk... One partition is $space % full."
;;
99)
Message="I'm drowning here! There's a partition at $space %!"
;;
*)
Message="I seem to be running with an nonexistent amount of disk space..."
;;
esac

echo $Message | mail -s "disk report `date`" anny

0 comments on commit a42d362

Please sign in to comment.