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
1,887 views 8 comments
by anonymous
I am using this script to keep zerotier alive on a RUT955

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
#!/bin/ash
while [ 1 ]; do
ping 10.241.199.144 -c 3 -q >/dev/null
ret=$?
if [ $ret -ne 0 ]; then
/etc/init.d/zerotier restart
fi
sleep 60
done

exit 0

However it stops the device rebooting properly

Is there anything I can change please

Thanks

James

1 Answer

0 votes
by anonymous

Hello, we had tested the Script originally by us, and the one you provided and the device responds with no problem to any reboot command.

Please try to factory reset the device by flashing a totally new firmware and then try to reboot without and after that with the zerotier and the script.

https://wiki.teltonika.lt/view/RUT955_Device_Recovery_Options#WebUI

Can you provide more detail on what are you getting so we can make a deeper test?

Regards

by
I will try again but I have now tried this on 3 devices all of which had just been upgraded to the latest firmware

One of them only cam out of the box on Saturday

They all appear to reboot and go through the reboot sequence but if you revisit the Status page the Router Uptime has not reset!
by anonymous
Hello, we tested under the situation in the conditions you described and found the behavior you describe. I will send the information to the R&D department and I will back to you as soon as we have an answer.
by anonymous

The device does not use reboot forcing because it waits while the scripts handle they're actions and shut off properly. So, the device interprets this script as an important task and waits for it to end. The solution would be to add -W [n] (where n is the amount of time to wait for a response. For example: ping 10.241.199.144 -c 3 -W 1 -q >/dev/null

Please test the following example using your corresponding IP number:

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.
#!/bin/ash
while [ 1 ]; do
ping 10.241.199.144 -c 3 -W 1 -q >/dev/null
ret=$?
if [ $ret -ne 0 ]; then
/etc/init.d/zerotier restart
fi
sleep 60
done

exit 0
by
Thanks I have tried this script in a router but it still will not reboot correctly when asked

The status page still shows that the device has not rebooted when asked for a manual reboot

Please advise what else I should try
by anonymous

Hi, sorry, there was a Typo mistake. 

can you test with ping 10.241.199.144 -c 3 -w 1 -q >/dev/null

Using a lowercase 'w' instead of capital 'W' ?

It worked for us here.

by anonymous
Script works ok for keeping ZeroTier alive........ but how do I restart the router if required?
by
I can confirm that this still causes the modem to not reboot.

Also, what is the IP address it is pinging? For me this ping always fails which causes Zerotier to constantly restart.
by anonymous

Hi. The IP address it is pinging should be changed for one IP address in your Zerotier Network.

Also. I made a comment about the reboot issue that we tested with no problem

"can you test with ping 10.241.199.144 -c 3 -w 1 -q >/dev/null

Using a lowercase 'w' instead of capital 'W' ?

It worked for us here."