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

Ping logic update #748

Closed
trentondyck opened this issue Feb 18, 2023 · 1 comment · Fixed by #749
Closed

Ping logic update #748

trentondyck opened this issue Feb 18, 2023 · 1 comment · Fixed by #749

Comments

@trentondyck
Copy link
Contributor

trentondyck commented Feb 18, 2023

Recent ping update changes the logic. instead it should be

! (ping -q -c1 archlinux.org &>/dev/null || ping -q -c1 google.com &>/dev/null)

we need to but the "not" symbol outside the "or" block to ensure we are logically requiring (logically equivalent to) both archlinux and google not being able to be pinged. See this simple test as a demonstration:

(1)(deck@steamdeck horizon_scripts)$ ! false || true
(deck@steamdeck horizon_scripts)$ echo $?
0
(deck@steamdeck horizon_scripts)$ ! true || false
(1)(deck@steamdeck horizon_scripts)$ echo $?
1
(deck@steamdeck horizon_scripts)$ ! (false || true)
(1)(deck@steamdeck horizon_scripts)$ echo $?
1
(deck@steamdeck horizon_scripts)$ ! (true || false)
(1)(deck@steamdeck horizon_scripts)$ echo $?
1

(deck@steamdeck horizon_scripts)$ 

This option passes shellcheck.

Originally posted by @trentondyck in #743 (comment)

@trentondyck trentondyck changed the title @sonic2kk that changes the logic. instead it should be Ping logic update Feb 18, 2023
@sonic2kk
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants