You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
523 B

#!/usr/bin/sh
partition=$1
if [ ! -n "$partition" ]; then
partition="/"
fi
line=$(/usr/bin/df -h $partition | sed -n 2p)
used=$(echo $line | awk -F ' ' '{print $3}')
total=$(echo $line | awk -F ' ' '{print $2}')
percent=$(echo $line | awk -F ' ' '{print $5}' | sed 's/[^0-9]//')
if [ "$BLOCK_BUTTON" = "1" ]; then
echo "$used/$total"
echo "$used/$total"
else
echo "$label $percent%"
echo "$label $percent%"
fi
if [ "$percent" -gt 80 ]; then
echo "#FF8000"
elif [ "$percent" -gt 90 ]; then
echo "#FF0000"
fi