#!/bin/sh
# This script is run before the package files are transferred to @appstore

# Minimum 512 MB of RAM is required to install Archiware P5
memoryrequired=500000;

totalmemory=$( awk '/^MemTotal/{print $2}'  /proc/meminfo)

if [ ${totalmemory} -lt ${memoryrequired} ]; then
    echo "Archiware P5 has detected that this device does not meet minimum system requirements for memory. Please consider installing Archiware P5 on a Synology NAS device with 512 MB or more of RAM memory." > $SYNOPKG_TEMP_LOGFILE
    exit 1
fi

exit 0
