Browse Source

Merge branch 'next' of github.com:rtCamp/easyengine into next

bugfixes
harshadyeola 11 years ago
parent
commit
a8547c0e55
  1. 12
      src/lib/ee_lib_create_swap.sh
  2. 2
      src/lib/ee_lib_ram.sh

12
src/lib/ee_lib_create_swap.sh

@ -7,22 +7,22 @@ function ee_lib_create_swap()
# Use dd command to create SWAP # Use dd command to create SWAP
# Swap Parameters: # Swap Parameters:
# Location: /swapfile # Location: /ee-swapfile
# Block Size: 1024 # Block Size: 1024
ee_lib_echo "Adding 1GB swapfile, please wait..." ee_lib_echo "Adding 1GB swapfile, please wait..."
dd if=/dev/zero of=/swapfile bs=1024 count=1024k &>> $EE_COMMAND_LOG \ dd if=/dev/zero of=/ee-swapfile bs=1024 count=1024k &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to generate /swapfile, exit status = " $? || ee_lib_error "Unable to generate /ee-swapfile, exit status = " $?
# Create it as a Swap # Create it as a Swap
mkswap /swapfile &>> $EE_COMMAND_LOG \ mkswap /ee-swapfile &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to create swapfile, exit status = " $? || ee_lib_error "Unable to create swapfile, exit status = " $?
# On the Swap # On the Swap
swapon /swapfile &>> $EE_COMMAND_LOG \ swapon /ee-swapfile &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to on Swap, exit status = " $? || ee_lib_error "Unable to on Swap, exit status = " $?
# Add entry into /etc/fstab # Add entry into /etc/fstab
echo "/swapfile none swap sw 0 0" >> /etc/fstab \ echo "/ee-swapfile none swap sw 0 0" >> /etc/fstab \
|| ee_lib_error "Unable to add entry into /etc/fstab, exit status = " $? || ee_lib_error "Unable to add entry into /etc/fstab, exit status = " $?
fi fi
fi fi

2
src/lib/ee_lib_ram.sh

@ -4,7 +4,7 @@ function ee_lib_ram()
{ {
# Detect RAM and SWAP of System # Detect RAM and SWAP of System
readonly EE_TOTAL_RAM=$(free -m | grep -i Mem | awk '{ print $2 }') readonly EE_TOTAL_RAM=$(free -m | grep -i Mem | awk '{ print $2 }')
readonly EE_TOTAL_SWAP=$(free -m | grep -i Swap | awk '{ print $2 }') readonly EE_TOTAL_SWAP=$(free -m --si | grep -i Swap | awk '{ print $2 }')
# RAM < 512MB # RAM < 512MB
if [ $EE_TOTAL_RAM -le 512 ]; then if [ $EE_TOTAL_RAM -le 512 ]; then

Loading…
Cancel
Save