mirror of
https://github.com/winapps-org/winapps.git
synced 2025-10-13 03:29:32 +02:00
Update winapps
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
This commit is contained in:
@@ -651,13 +651,16 @@ function waCheckIdle() {
|
|||||||
# Name: 'waTimeSync'
|
# Name: 'waTimeSync'
|
||||||
# Role: Detect if system went to sleep by comparing uptime progression, then sync time in Windows VM
|
# Role: Detect if system went to sleep by comparing uptime progression, then sync time in Windows VM
|
||||||
function waTimeSync() {
|
function waTimeSync() {
|
||||||
local CURRENT_TIME=$(date +%s)
|
local CURRENT_TIME
|
||||||
local CURRENT_UPTIME="$(awk '{print int($1)}' "/proc/uptime")"
|
local CURRENT_UPTIME
|
||||||
local STORED_TIME=0
|
local STORED_TIME=0
|
||||||
local STORED_UPTIME=0
|
local STORED_UPTIME=0
|
||||||
local EXPECTED_UPTIME=0
|
local EXPECTED_UPTIME=0
|
||||||
local UPTIME_DIFF=0
|
local UPTIME_DIFF=0
|
||||||
|
|
||||||
|
CURRENT_TIME=$(date +%s)
|
||||||
|
CURRENT_UPTIME=$(awk '{print int($1)}' /proc/uptime)
|
||||||
|
|
||||||
# Read stored values if file exists
|
# Read stored values if file exists
|
||||||
if [ -f "$SLEEP_DETECT_PATH" ]; then
|
if [ -f "$SLEEP_DETECT_PATH" ]; then
|
||||||
STORED_TIME=$(head -n1 "$SLEEP_DETECT_PATH" 2>/dev/null || echo 0)
|
STORED_TIME=$(head -n1 "$SLEEP_DETECT_PATH" 2>/dev/null || echo 0)
|
||||||
|
Reference in New Issue
Block a user