Browse Source

Added SWAP creation function

bugfixes
gau1991 10 years ago
parent
commit
16cc9218ba
  1. 23
      src/lib/ee_lib_create_swap.sh
  2. 2
      src/lib/ee_lib_ram.sh

23
src/lib/ee_lib_create_swap.sh

@ -0,0 +1,23 @@
# EasyEngine Swap creation
function ee_lib_create_swap()
{
# Use dd command to create SWAP
# Swap Parameters:
# Location: /swapfile
# Block Size: 1024
dd if=/dev/zero of=/swapfile bs=1024 count=1024k \
|| ee_lib_error "Unable to generate /swapfile, exit status = " $?
# Create it as a Swap
mkswap /swapfile \
|| ee_lib_error "Unable to create swapfile, exit status = " $?
# On the Swap
swapon /swapfile \
|| ee_lib_error "Unable to on Swap, exit status = " $?
# Add entry into /etc/fstab
echo "/swapfile none swap sw 0 0" >> /etc/fstab \
|| ee_lib_error "Unable to add entry into /etc/fstab, exit status = " $?"
}

2
src/lib/ee_lib_ram.sh

@ -11,11 +11,13 @@ function ee_lib_ram()
EE_MEMCACHE_SIZE="64"
EE_PHP_MAX_CHILDREN="10"
EE_SETUP_MAILSCANNER="no"
EE_SWAP="1024"
# RAM > 512MB and RAM < 1024MB
elif [ $EE_TOTAL_RAM -gt 512 ] && [ $EE_TOTAL_RAM -le 1024 ]; then
EE_OPCACHE_SIZE="128"
EE_MEMCACHE_SIZE="128"
EE_PHP_MAX_CHILDREN="10"
EE_SWAP="1024"
# RAM > 1024MB and RAM < 2048MB
elif [ $EE_TOTAL_RAM -gt 1024 ] && [ $EE_TOTAL_RAM -le 2048 ]; then
EE_OPCACHE_SIZE="256"

Loading…
Cancel
Save