#!/bin/sh

# Stat helpers
##############

# Get update in second
getUptime() {
  awk '{print int($1)}' /proc/uptime
}

# Get CPU load in percent (0 - 100)
getCpuLoad() {
  grep 'cpu ' /proc/stat | awk '{print int(($2+$4)*100/($2+$4+$5))}'
}

# Get total RAM free in kB
getRamFree() {
  grep MemFree /proc/meminfo | awk '{print $2}'
}

getRamTotal() {
  grep MemTotal /proc/meminfo | awk '{print $2}'
}
