[Axel Beckert]
> +      # check for free disk size percentage and don't overstep it
> +      AVAIL_KB=$(/bin/df --output=avail "$(dirname "${CONF_SWAPFILE}")" | 
> tail -1)

Note, I suspect this use of 'dirname' is a bad idea.  'df' can give
different result for /some/path and /some/path/file, and you want the
result for the latter.  For example, if /some/path is a autofs mount
point that is not yet mounted, I believe 'df' will report data for the
dummy mount point and not the file system mounted when accessing
/some/path/file.  Because of this, I would suggest to touch the file
first and then run 'df' on it, to make sure df report the space on the
file system where the file is located.

Happy hacking
Petter Reinholdtsen

Reply via email to