diff --git a/bin/easyengine b/bin/easyengine index df823ea7..db820c83 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -47,7 +47,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then if [ "$EE_SECOND" = "install" ]; then # Detect RAM of system and initialize the variables. ee_lib_ram - ee_lib_create_swap + ee_lib_swap if [ "$EE_THIRD" = "nginx" ] || [ "$EE_THIRD" = "php" ] || [ "$EE_THIRD" = "mysql" ] || [ "$EE_THIRD" = "postfix" ] || [ "$EE_THIRD" = "adminer" ] || [ "$EE_THIRD" = "phpmyadmin" ] || [ "$EE_THIRD" = "wpcli" ] || [ "$EE_THIRD" = "utils" ]; then if [ "$EE_THIRD" = "nginx" ] || [ "$EE_THIRD" = "php" ] || [ "$EE_THIRD" = "mysql" ]; then # Setup NGINX/PHP repository diff --git a/src/lib/ee_lib_ram.sh b/src/lib/ee_lib_ram.sh index b96d9bef..cc9c9120 100644 --- a/src/lib/ee_lib_ram.sh +++ b/src/lib/ee_lib_ram.sh @@ -4,7 +4,7 @@ function ee_lib_ram() { # Detect RAM and SWAP of System readonly EE_TOTAL_RAM=$(free -m | grep -i Mem | awk '{ print $2 }') - readonly EE_TOTAL_SWAP=$(free -m --si | grep -i Swap | awk '{ print $2 }') + readonly EE_TOTAL_SWAP=$(free -m | grep -i Swap | awk '{ print $2 }') # RAM < 512MB if [ $EE_TOTAL_RAM -le 512 ]; then diff --git a/src/lib/ee_lib_create_swap.sh b/src/lib/ee_lib_swap.sh similarity index 89% rename from src/lib/ee_lib_create_swap.sh rename to src/lib/ee_lib_swap.sh index 3fde4dc8..5f9edba0 100644 --- a/src/lib/ee_lib_create_swap.sh +++ b/src/lib/ee_lib_swap.sh @@ -1,6 +1,6 @@ # EasyEngine Swap creation -function ee_lib_create_swap() +function ee_lib_swap() { if [ $EE_TOTAL_RAM -le 512 ]; then if [ $EE_TOTAL_SWAP -le $EE_SWAP ];then @@ -10,7 +10,7 @@ function ee_lib_create_swap() # Location: /ee-swapfile # Block Size: 1024 ee_lib_echo "Adding 1GB swapfile, please wait..." - dd if=/dev/zero of=/ee-swapfile bs=1024 count=1024k &>> $EE_COMMAND_LOG \ + dd if=/dev/zero of=/ee-swapfile bs=1024 count=1048k &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to generate /ee-swapfile, exit status = " $? # Create it as a Swap