#!/bin/sh

me="[S80sysctl]"

# To ensure the memory manager can do it's job this value is at least needed.
REQUIRED_MIN_FREE_VALUE=1024
MIN_FREE_VALUE=$(sysctl -n vm.min_free_kbytes)

if [ ${MIN_FREE_VALUE} -lt ${REQUIRED_MIN_FREE_VALUE} ]
then
  printf "%s The value for min_free_kbytes of the vm is less than required.\\n" "${me}"
  printf "%s Setting min_free_kbytes to %s.\\n" "${me}" "${REQUIRED_MIN_FREE_VALUE}"
  sysctl -w vm.min_free_kbytes=${REQUIRED_MIN_FREE_VALUE}
fi

exit 0
