WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: provides.sh pinging 8.8.8.8 --- bug or feature ? piCore 64 , 16.x  (Read 88 times)

Offline uli

  • Newbie
  • *
  • Posts: 12
I am using piCore 64 (16.x, ... excellent!)  behind a firewall with proxy web access. All working well afaics. Except provides.db cannot be downloaded, since provides.sh tries to ping 8.8.8.8.

I cannot quite believe that this could possibly be an intended feature. There must be other places within tiny / Core where network access is being probed and confirmed successfully, even behind my firewall. Maybe trying to ping the selected mirror would be a better option ? Or whatever the default probing in other Core scripts might be...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12153
Re: provides.sh pinging 8.8.8.8 --- bug or feature ? piCore 64 , 16.x
« Reply #1 on: June 17, 2025, 12:53:58 PM »
Hi uli
Feature. It was added to check connectivity to the outside world.
You can read about how it evolved starting around here:
https://forum.tinycorelinux.net/index.php/topic,27363.msg176244.html#msg176244

Offline uli

  • Newbie
  • *
  • Posts: 12
Re: provides.sh pinging 8.8.8.8 --- bug or feature ? piCore 64 , 16.x
« Reply #2 on: June 17, 2025, 02:53:11 PM »
Hi Rich,
Thanks for explanation.
Fixed it for my specific use case then. Just wouldn't have thought it to be a rare case, sitting behind a somewhat restrictive firewall...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12153
Re: provides.sh pinging 8.8.8.8 --- bug or feature ? piCore 64 , 16.x
« Reply #3 on: June 17, 2025, 11:51:50 PM »
Hi uli
... There must be other places within tiny / Core where network access is being probed and confirmed successfully, ...
Hi GNUser
... Why not go with Robert's approach (which shows up in  tc-config  and  settime.sh ):
Code: [Select]
ifconfig | grep -q Bcast || return 1 ...
Funny you should mention it. That will detect the NIC was brought up.
It will not detect an unplugged network cable or problems upstream.
Oh, and watch this:
Code: [Select]
tc@box:~$ ifconfig eth0 | grep Bcast
          inet addr:192.168.1.45  Bcast:192.168.1.255  Mask:255.255.255.0
tc@box:~$ sudo ifconfig eth0 down
tc@box:~$ ifconfig eth0 | grep Bcast
          inet addr:192.168.1.45  Bcast:192.168.1.255  Mask:255.255.255.0
tc@box:~$

I also considered using this:
Code: [Select]
ifconfig eth0 | grep RUNNINGThat will detect taking down the NIC and unplugging the network cable.
While it detects a disconnect between computer and network switch, it
won't detect a disconnect between network switch and router.
The Apps utility will hang for a minute or two if it can't connect to
the repo, a behavior we want to avoid in provides.sh.

Quote
... Maybe trying to ping the selected mirror would be a better option ? ...
Hi t18
Pinging the repo will temporarily lock you out:
... About the ping, that's part of the port scanning protection. You essentially blocked yourself for a short time.
...

... Just wouldn't have thought it to be a rare case, ...
You are the first person to report this as an issue.