Commit 025e6110 authored by Michael Shigorin's avatar Michael Shigorin

mktmpdir: fixed sort key

The sort key field value has been off-by-one apparently, "6" corresponds to "capacity" field of df -PT output while the "available" one was meant: Filesystem Type 1024-blocks Used Available Capacity Mounted on /dev/sda9 ext4 15350768 12799972 1747980 88% / tmpfs tmpfs 1967204 27396 1939808 2% /tmp 1 2 3 4 5 6 This lapse has been five years old, looks like it's only been masked by lower available space limit *and* filesystem ordering by type so far. It didn't hit me even now, rather inspected the code while implementing volumes-profile-starterkit...
parent 881163dc
......@@ -45,7 +45,7 @@ choose_tmpdir() {
echo -n "$i "
df -PT "$i" | tail -1
done \
| sort -unk6 \
| sort -unk5 \
| while read dir dev fstype size used free percent mnt; do
check_options "$dev" "$mnt" || continue
[ "$free" -gt "$MINSIZE" ] || continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment