summaryrefslogtreecommitdiffstats
path: root/alert
blob: 31a83fbbd48fcad3a0d8c7d52eaa1464d443f858 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/zsh
needed=$(/bin/df -h  | /bin/grep -E '(/home$|/$)')

for line in ${(f)needed};do
    free=$(awk '{ print $5 }' <<< $line)
    if [[ ${free%\%} -gt 94 ]];then
        echo -n -e " Alert: Disk Low"
        break
    fi
done
#echo -n -e ""