mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 23:12:32 +01:00
hm hm hm
This commit is contained in:
parent
25a4ad7b28
commit
effa8a6eb5
@ -2,9 +2,10 @@
|
||||
|
||||
warning=85
|
||||
critical=95
|
||||
target="$1"
|
||||
|
||||
# Detect slash FSType
|
||||
fstype=$(df -l "$1" --output=fstype | sed 1d)
|
||||
fstype=$(findmnt -nT "$target" -o FSTYPE)
|
||||
|
||||
# Set query cmd
|
||||
if [[ -z "$fstype" ]]
|
||||
@ -12,10 +13,10 @@ then
|
||||
exit
|
||||
elif [[ "$fstype" == zfs ]]
|
||||
then
|
||||
zfsroot=$(echo $1 | sed 's:/.*::')
|
||||
zfsroot=$(echo $target | sed 's:/.*::')
|
||||
pcent=$(zpool list -o cap -H $zfsroot | tr -d '%')
|
||||
else
|
||||
pcent=$(df "$1" --output="pcent" 2>/dev/null | sed 1d | tr -d ' ' | tr -d '%')
|
||||
pcent=$(df "$target" --output="pcent" 2>/dev/null | sed 1d | tr -d ' ' | tr -d '%')
|
||||
fi
|
||||
|
||||
json_fmt='{"text": "%s" , "class": "%s" }\n'
|
||||
|
Loading…
Reference in New Issue
Block a user