#!/bin/sh

MEM=$(free -m | awk '{print $2}' | awk 'NR==2')
MEMORY_TMP=$((512 / 2))
if [ $MEM -lt $MEMORY_TMP ]; then
    #Director
    if [ -e "$SYNOPKG_PKGDEST/nkv-dirsvc" ]; then
        echo "The system has insufficient memory for running the package.
              The minimum required amount of memory is 1.0 GB." >>$SYNOPKG_TEMP_LOGFILE
        exit 1
    fi

    echo "The system has insufficient memory for running the package.
              The minimum required amount of memory is 512 MB." >>$SYNOPKG_TEMP_LOGFILE
    exit 1

fi

exit 0
