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

Read specific condition on/off from external script #255

Closed
troglobit opened this issue Apr 30, 2022 Discussed in #251 · 1 comment
Closed

Read specific condition on/off from external script #255

troglobit opened this issue Apr 30, 2022 Discussed in #251 · 1 comment
Assignees
Milestone

Comments

@troglobit
Copy link
Owner

Discussed in #251

Originally posted by hongkongkiwi April 28, 2022
I have a need to read signal status from a bash script. e.g I have lte_connected and wifi_connected

is there a similar command to initctl -a status "service" but for conditions to know if they are set?

Right now I'm using:

initctl -b -p cond dump | awk '{ print $4 }' | grep -q '^<usr/wifi_connected>'

This method is a bit awkward and involves two additional tools.

@troglobit troglobit added this to the 4.3 milestone Apr 30, 2022
@troglobit troglobit self-assigned this Apr 30, 2022
troglobit added a commit that referenced this issue Apr 30, 2022
Fix issue #255

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
Copy link
Owner Author

root@zero:~# initctl cond get foo
root@zero:~# initctl -v cond get foo
off
root@zero:~# initctl -v cond set foo
root@zero:~# initctl -v cond get foo
on
root@zero:~# echo $?
0
root@zero:~# initctl -v cond clr foo
root@zero:~# initctl -v cond get foo
off
root@zero:~# echo $?
1

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

No branches or pull requests

1 participant