Remove dir_mount_map variable

This commit is contained in:
Amin Vakil 2022-01-11 09:30:52 +03:30
parent 2c155e9e4e
commit ca85d56f4b
No known key found for this signature in database
GPG Key ID: 1EFC1864E9D9E56B

View File

@ -275,7 +275,7 @@ pre_check () {
fi fi
local -a errs dirs=("${!dir_space_map[@]}") local -a errs dirs=("${!dir_space_map[@]}")
local dir mount avail i=0 local dir mount avail i=0
local -A mount_avail_map dir_mount_map mount_space_map local -A mount_avail_map mount_space_map
while read -r mount avail; do while read -r mount avail; do
if [[ $mount == 'Filesystem' ]]; then if [[ $mount == 'Filesystem' ]]; then
continue continue
@ -283,7 +283,6 @@ pre_check () {
dir=${dirs[$((i++))]} dir=${dirs[$((i++))]}
dir_mount_map[$dir]=$mount
mount_avail_map[$mount]=${avail%M} mount_avail_map[$mount]=${avail%M}
(( mount_space_map[$mount]+=dir_space_map[$dir] )) (( mount_space_map[$mount]+=dir_space_map[$dir] ))
done < <(df -BM --output=source,avail "${dirs[@]}") done < <(df -BM --output=source,avail "${dirs[@]}")