Skip to content

Commit

Permalink
get free memory on linux in bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
simylein committed Mar 13, 2021
1 parent bb2f776 commit 0787fda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ "$(uname)" == "Darwin" ]; then
fi
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# get free memory on linux
memory="$(free | tail -2 | head -1 | awk '{print $4}')"
memory="$(free -b | tail -2 | head -1 | awk '{print $4}')"
# check memory
if (( ${memory} < 2560000000 )); then
echo "$(tput bold)$(tput setaf 3)warning: your system has less than 2.56 GB of memory - this may impact server performance!$(tput sgr0)"
Expand Down

0 comments on commit 0787fda

Please sign in to comment.