Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_update.sh infinitely attempts to check for a new version if the github url isnt resolvable #407

Open
maki43 opened this issue Nov 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature, improvement, or request

Comments

@maki43
Copy link

maki43 commented Nov 3, 2024

Describe the bug
I have a firewall rule on my router for my yi cameras which prevents any internet access in or out to ensure unintended connections are not possible. The intent of the code in check_update.sh is to check to see if a new version is available via a wget from git and, if unsuccessful following 10 failures, make no further attempts.

I run a private DNS server and i noticed a lot of requests from my yi cameras trying to get the IP for git. The attempts would be every few seconds and happen continuously throughout the day. As my private DNS server is on my LAN the cameras can access it, so while they can request the IP they are unable to download the file. It appears that if the file cant be downloaded it retries forever.

To Reproduce
Steps to reproduce the behaviour:

  1. make sure updates are set to on
  2. Allow the DNS to resolve (unsure if this is the cause, it just allowed me to see the problem)
  3. block internet connections for the cameras ip
  4. restart the camera
  5. monitor the DNS requests and you'll see continuous attempts

Obviously the above would occur if they have no internet connection or git it down etc...

Expected behaviour
Once check_updates.sh is triggered by cron, it should stop any further attempts after 10 failures as the code intended.

Technical Details
I believe its bcause the N_RETRY variable to store the number of attempts is not being set correctly. It uses the following to increment the number of tries:

((N_RETRY++))

While this will work on some shells, it wont work on all of them. I tried this on my CentOS machine and it will increment the variable. I SSHd into the camera and attempted the same and it errored.

I believe the code should do the following instead:

N_RETRY=$(( N_RETRY+1 ))

My current work around is to set the updates to off which is the default anyway.

@maki43 maki43 added the bug Something isn't working label Nov 3, 2024
Copy link

github-actions bot commented Dec 4, 2024

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
@alienatedsec alienatedsec reopened this Dec 11, 2024
@alienatedsec alienatedsec added enhancement New feature, improvement, or request and removed issue-stale labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature, improvement, or request
Projects
None yet
Development

No branches or pull requests

2 participants