Browse Source

Optim

pull/276/head
Poil 10 years ago
parent
commit
b3bd56a2ad
  1. 14
      functions/fn_details_distro
  2. 14
      functions/fn_distrodetails

14
functions/fn_details_distro

@ -48,12 +48,12 @@ if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then
else
option="-h"
fi
physmemtotal=$(free ${option} | grep "Mem:" | awk '{print $2}')
physmemused=$(free ${option} | grep "Mem:" | awk '{print $3}')
physmemfree=$(free ${option} | grep "Mem:" | awk '{print $4}')
swaptotal=$(free ${option} | grep "Swap:" | awk '{print $2}')
swapused=$(free ${option} | grep "Swap:" | awk '{print $3}')
swapfree=$(free ${option} | grep "Swap:" | awk '{print $4}')
physmemtotal=$(free ${option} | awk '/Mem:/ {print $2}')
physmemused=$(free ${option} | awk '/Mem:/ {print $3}')
physmemfree=$(free ${option} | awk '/Mem:/ {print $4}')
swaptotal=$(free ${option} | | awk '/Swap:/ {print $2}')
swapused=$(free ${option} | awk '/Swap:/ {print $3}')
swapfree=$(free ${option} | awk '/Swap:/ {print $4}')
# Uptime
uptime=$(</proc/uptime)
@ -87,4 +87,4 @@ if [ -d "${backupdir}" ]; then
# size of most recent backup.
lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}')
fi
fi

14
functions/fn_distrodetails

@ -48,12 +48,12 @@ if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then
else
option="-h"
fi
physmemtotal=$(free ${option} | grep "Mem:" | awk '{print $2}')
physmemused=$(free ${option} | grep "Mem:" | awk '{print $3}')
physmemfree=$(free ${option} | grep "Mem:" | awk '{print $4}')
swaptotal=$(free ${option} | grep "Swap:" | awk '{print $2}')
swapused=$(free ${option} | grep "Swap:" | awk '{print $3}')
swapfree=$(free ${option} | grep "Swap:" | awk '{print $4}')
physmemtotal=$(free ${option} | awk '/Mem:/ {print $2}')
physmemused=$(free ${option} | awk '/Mem:/ {print $3}')
physmemfree=$(free ${option} | awk '/Mem:/ {print $4}')
swaptotal=$(free ${option} | | awk '/Swap:/ {print $2}')
swapused=$(free ${option} | awk '/Swap:/ {print $3}')
swapfree=$(free ${option} | awk '/Swap:/ {print $4}')
# Uptime
uptime=$(</proc/uptime)
@ -87,4 +87,4 @@ if [ -d "${backupdir}" ]; then
# size of most recent backup.
lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}')
fi
fi

Loading…
Cancel
Save