mirror of
https://github.com/tw93/Mole.git
synced 2026-02-07 20:54:21 +00:00
Supports multi-disk detection
This commit is contained in:
@@ -132,8 +132,10 @@ check_cache_size() {
|
||||
|
||||
for cache_path in "${cache_paths[@]}"; do
|
||||
if [[ -d "$cache_path" ]]; then
|
||||
local size=$(du -sk "$cache_path" 2>/dev/null | awk '{print $1}' || echo "0")
|
||||
cache_size_kb=$((cache_size_kb + size))
|
||||
local size_output
|
||||
size_output=$(du -sk "$cache_path" 2>/dev/null | awk 'NR==1 {print $1}' | tr -d '[:space:]' || echo "")
|
||||
[[ "$size_output" =~ ^[0-9]+$ ]] || size_output=0
|
||||
cache_size_kb=$((cache_size_kb + size_output))
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user