From 8c4faefa68c1d32a7df699ee13862b5af3503293 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 31 Oct 2023 16:19:49 +0300 Subject: [PATCH] nanosleep: use ucode on newer openwrt --- common/base.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/base.sh b/common/base.sh index 7bd113a..ed8db77 100644 --- a/common/base.sh +++ b/common/base.sh @@ -208,6 +208,9 @@ fsleep_setup() local errtext=$(read -t 0.001 2>&1) if [ -z "$errtext" ]; then FSLEEP=3 + # newer openwrt has ucode with system function that supports timeout in ms + elif ucode -e "system(['sleep','infinity'], 1)"; then + FSLEEP=4 else FSLEEP=0 fi @@ -226,6 +229,9 @@ minsleep() 3) read -t 0.1 ;; + 4) + ucode -e "system(['sleep','infinity'], 100)" + ;; *) sleep 1 esac