FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
80 views 0 comments
by anonymous

Hello community.

There is next issue: I have TRB245 with custom script that makes ping request each 40 sec. Device works correctly but when I make reboot via UI I cannot get access to my TRB245 anymore. To retrieve access to it I should switch power supply OFF and then ON. If I remove custom script, device rebooting via UI works correctly. Script text:

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.

#!/bin/ash

/etc/init.d/ioman restart

/etc/init.d/rs_overip restart

sleep 45

while [ 1 ]; do

 sleep 35

 ping 192.168.1.170 -s 0 -c 3 -q >/dev/null

 ret=$?

 if [ $ret -ne 0 ]; then

    logger "Mobile disconnected"

    ubus call ioman.gpio.dio2 update '{"value":"1"}'

 else

    logger "Mobile connected"

    ubus call ioman.gpio.dio2 update '{"value":"0"}'

 fi

done

exit 0

What wrong I do?  

1 Answer

0 votes
by anonymous
Hello,

  

Let's continue this thread in the original post. I left a comment there, that the issue is most likely caused by an infinite while loop. To avoid it, I recommend using a Crontab to run the script periodically, rather than continuously. More information can be found in my previous comment.

  

Best regards,
DaumantasG