View Single Post
Old 07-23-2022, 02:56 AM   #1
Rid
Addict
Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.
 
Posts: 209
Karma: 20980
Join Date: Oct 2020
Device: Kobo Aura One, Aura HD (R.I.P.) :(
help needed - sleep cmd issue in .sh script

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
Rid is offline   Reply With Quote