Quantcast
Channel: MobileRead Forums - Kobo Developer's Corner
Viewing all articles
Browse latest Browse all 1562

help needed - sleep cmd issue in .sh script

$
0
0
Having issues with a script that I want to sleep for a certain amount of time before it starts the next step but I seem to be getting mixed results. For example if I set sleep to 1 second it seems fine. Set to 30 seconds it can take 1m20s to end the script or even 3min. I am using NickelDBus and :cmd_spawn :quiet in NickelMenu to start the script. Would this be the script or am I going about this the wrong way?

I stripped my original script and tried testing with the below.
Code:

#!/bin/sh
#Version 1.0 sleep testing

#Define functions
Func_LogApp01(){
        LogVar01="$1"
        LogDateStamp01=`date '+%d/%m/%Y - %T'`
        LogAppOutput01="${LogVar01} ${LogDateStamp01}"
        echo $LogAppOutput01 >> $LogFile01
}
       
#Define variables
LogFile01=/mnt/onboard/.adds/WifiTimer.txt
TimerDurSec01=30

echo -e >> $LogFile01
Func_LogApp01 "-->Begin:"
sleep $TimerDurSec01       
qndb -m mwcToast 2000 "Timer ended..."
Func_LogApp01 "-->End:"
echo -e >> $LogFile01


Viewing all articles
Browse latest Browse all 1562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>