Browse Source

Improved Functions

old-stable
gau1991 10 years ago
parent
commit
8f4085caa9
  1. 5
      src/lib/ee_lib_create_swap.sh
  2. 3
      src/lib/ee_lib_ram.sh

5
src/lib/ee_lib_create_swap.sh

@ -2,6 +2,9 @@
function ee_lib_create_swap()
{
if [ $EE_TOTAL_RAM -le 512 ]; then
if [ $EE_TOTAL_SWAP -le $EE_SWAP ];then
# Use dd command to create SWAP
# Swap Parameters:
# Location: /swapfile
@ -20,4 +23,6 @@ function ee_lib_create_swap()
# 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 = " $?
fi
fi
}

3
src/lib/ee_lib_ram.sh

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

Loading…
Cancel
Save