You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

11 lines
317 B

#! /bin/bash
last_wakeup_str=`grep "Enabling non-boot CPUs ..." /var/log/kern.log | tail -n 1 | egrep -o '^.*..:..:..' | head -1`
[ -z "$last_wakeup_str" ] && echo -1 && exit 1
wakeup_unix="$(date --date="$last_wakeup_str" +%s)"
now_unix="$(date +%s)"
delta_s=$(( now_unix - wakeup_unix ))
echo "$delta_s"
exit 0