-
Notifications
You must be signed in to change notification settings - Fork 41
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
Script hangs while waiting for stdin #44
Comments
Good catch, thanks. I'll see what I can do to fix that. |
Is it fixed? I have a problem with Deluge execute script `#!/bin/zsh torrentId=$1 ~/pushbullet-bash/pushbullet push all note "Deluge" "$torrentName" &> /dev/null |
@Haxy89 I am not really familiar with zsh, but the exit 1 can originate from the fact that you should call pushbullet-bash like ./pushbullet and not ~/pushbullet. As @idefixx said pushbullet-bash will hang if the script does not find something in the pipe and not fail. But honestly I think the issue is more with deluge as with pushbullet-bash as test ! -t 0 is a valid solution. |
I'd like to add that I experienced the same issue calling pushbullet from a bash script.
My script wouldn't exit because pushbullet got hung up invoking cat even though there was nothing passed to it via stdin.
|
I played a bit with the following approach some months ago, but never pushed it upstream: Can you see if that does the trick for you as well? Then I can create a pull request for this. |
In my rudimentary testing, your patch does allow my script to execute correctly. Some warnings, though:
So I'm certainly not a reliable test as to whether this definitely fixes the issue, sorry! |
Yes, thats my experience as well. If you turn to places like stackoverflow, you get a lot if answers suggesting to implement it like it is in the current pushbullet-bash version. The change I tested with has the benefit of being able to timeout after a while. But in general to me it seems more of a problem of the calling script, than pushbullet-bash itself. But thats just my two cents. |
IMO, the proper way to fix this issue would be to:
|
This is so we can pipe notes to the script, right? It causes issues when run from other scripts though.
Used pushbullet-bash in Deluge for notifications and as an upstart job in both cases it seemed to think a terminal was connected and hung at 'cat'. Not the best solution I guess.
The text was updated successfully, but these errors were encountered: