1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 06:08:21 +00:00

reduce ping times for faster script completion

Signed-off-by: Jacob Salmela <jacob.salmela@pi-hole.net>
This commit is contained in:
Jacob Salmela 2018-03-23 00:11:21 -05:00
parent e131395cce
commit 7159ecb632
No known key found for this signature in database
GPG Key ID: 1962FF1A5046135E

View File

@ -592,7 +592,7 @@ ping_gateway() {
# Try to quietly ping the gateway 3 times, with a timeout of 3 seconds, using numeric output only,
# on the pihole interface, and tail the last three lines of the output
# If pinging the gateway is not successful,
if ! ${cmd} -c 3 -W 2 -n ${gateway} -I ${PIHOLE_INTERFACE} >/dev/null; then
if ! ${cmd} -c 1 -W 2 -n ${gateway} -I ${PIHOLE_INTERFACE} >/dev/null; then
# let the user know
log_write "${CROSS} ${COL_RED}Gateway did not respond.${COL_NC} ($FAQ_GATEWAY)\n"
# and return an error code
@ -613,7 +613,7 @@ ping_internet() {
ping_ipv4_or_ipv6 "${protocol}"
log_write "* Checking Internet connectivity via IPv${protocol}..."
# Try to ping the address 3 times
if ! ${cmd} -W 2 -c 3 -n ${public_address} -I ${PIHOLE_INTERFACE} >/dev/null; then
if ! ${cmd} -c 1 -W 2 -n ${public_address} -I ${PIHOLE_INTERFACE} >/dev/null; then
# if it's unsuccessful, show an error
log_write "${CROSS} ${COL_RED}Cannot reach the Internet.${COL_NC}\n"
return 1