#!/bin/sh
# Copyright (C) 2000-2016 Synology Inc. All rights reserved.

### This script will be execute when package installed and upgraded.
### Actions before package installed.
### ex. check environment.

TotalMemoryKb=`awk '/MemTotal/ {print $2}' /proc/meminfo`
DivisorKBtoGB=$((1024*1024))
TotalMemoryGB=$(( ($TotalMemoryKb + $DivisorKBtoGB - 1) / $DivisorKBtoGB ))

if [ "$TotalMemoryGB" -ge "4" ]; then
	echo "memory larger than 4GB and lese than to 4GB"
	exit 0
else	
	echo "memory lower than 4GB" > "$SYNOPKG_TEMP_LOGFILE"
	exit 1
fi

