#!/bin/sh

UTILS_PROC_UPTIME="/proc/uptime"

daemon_utils_uptime () {
    cat ${UTILS_PROC_UPTIME} | sed -r "s/([0-9]+).*/\1/g"
}

daemon_utils_uptime_diff () {
    local PREVIOUS_UPTIME=$1
    local CURRENT_UPTIME=`daemon_utils_uptime`

    echo $((CURRENT_UPTIME - PREVIOUS_UPTIME))
}