Compare commits

..

2 Commits

Author SHA1 Message Date
d1cd9dddf1 Add quotes around location variable. 2025-11-10 15:08:26 -07:00
68eb84af52 Fix missing then. 2025-11-10 15:07:45 -07:00

View File

@@ -5,16 +5,16 @@ function storage {
location="$1" location="$1"
style="$2" style="$2"
if [[ -z $location ]]; then if [[ -z "$location" ]]; then
echo "ERROR: Location must be passed. $location" echo "ERROR: Location must be passed. $location"
fi fi
if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then
df -h $location | tail -n 1 | awk {print $5} df -h "$location" | tail -n 1 | awk {print $5}
elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]] elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]]; then
df -h $location | tail -n 1 | awk {print $3"/"$2} df -h "$location" | tail -n 1 | awk {print $3"/"$2}
else else
df -h $location | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} df -h "$location" | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"}
fi fi
} }