Reboot stoped working after i added script in rc.local with while

I have created script for gathering status of my USB modem via socat
on OpenWRT 19.7.3


#!/bin/sh
while [ true ]; do
 sleep 10
 # do what you need to here

date +"%d.%m.%y %T" >>/tmp/newlogrun
echo AT+CGSN | socat - /dev/ttyUSB2,crnl | grep 863 >>/tmp/newlogrun

done

and added to rc.local
Script works fine but i cant reboot router anymore
if i kill the script in process i can reboot
what should i do

I have find the solution i had to use procd insted
1 create file with name gather in /etc/init.d with

#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2014 OpenWrt.org

START=100 

USE_PROCD=1

start_service() {
  procd_open_instance
  procd_set_param command "/root/runcollect.sh"

}

2 crete simlink in /etc/rc.d with name S100gather and link to ../init.d/gather

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.