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

dcping: Set return code on error #105

modelrockettier opened this issue Nov 2, 2019 · 0 comments


Copy link

@modelrockettier modelrockettier commented Nov 2, 2019

The dcping ping command always exits with a 0 status, which makes it harder to integrate into scripts since you have to parse through the output to figure out if the hub is working.

It would be nice if dcping ping followed the standard conventions of returning 0 on success and non-zero if something goes wrong (it could also be handy to have different return codes for different errors, but even just a single error code would be nice to differentiate it from a successful ping).


# dcping ping 2>/dev/null
{"name":"GoHub","desc":"Hybrid hub","addr":["adcs://"],"encoding":"utf-8","soft":{"name":"GoHub","vers":"0.20.0","ext":["BAS0","TIGR","PING","UCMD","UCM0","ZLIF","BASE"]},"users":1}

# echo "Return code: $?"
Return code: 0

# dcping ping 2>/dev/null

# echo "Return code: $?" # It would be nice if this was not 0
Return code: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.