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

Status check #146

Closed
jschaefer-pott opened this issue Mar 21, 2019 · 2 comments
Closed

Status check #146

jschaefer-pott opened this issue Mar 21, 2019 · 2 comments
Labels

Comments

@jschaefer-pott
Copy link

I am running ./uhubctl -a off -l 2-1.8 -p 1 to disable my port. Is there another way to check whether a port is activated or deactivated other than reading stdout and checking for
New status for hub 2-1.8 [05e3:0608 USB2.0 Hub, USB 2.10, 4 ports] Port 1: 0100 power ?

@mvp
Copy link
Owner

mvp commented Mar 21, 2019

You can check the status by following hack:

status=$(uhubctl -l 2-1.8 -p 1 | tail -1 | awk '{print $4}')

status will contain string off if port is off, and power if port is on.

@mvp
Copy link
Owner

mvp commented Mar 21, 2019

There is feature request to add JSON output which would make it easier to parse in scripts: #124.
But I have not found time to implement this yet, as it requires almost full rewrite of reporting functions.

@mvp mvp closed this as completed Mar 21, 2019
@mvp mvp added the question label Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants