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.
31 lines
523 B
31 lines
523 B
7 years ago
|
#!/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]//')
|
||
|
|
||
|
|
||
7 years ago
|
if [ "$BLOCK_BUTTON" = "1" ]; then
|
||
|
echo "$used/$total"
|
||
|
echo "$used/$total"
|
||
|
else
|
||
6 years ago
|
echo "$label $percent%"
|
||
|
echo "$label $percent%"
|
||
7 years ago
|
fi
|
||
7 years ago
|
|
||
|
|
||
|
if [ "$percent" -gt 80 ]; then
|
||
|
echo "#FF8000"
|
||
|
elif [ "$percent" -gt 90 ]; then
|
||
|
echo "#FF0000"
|
||
|
fi
|