Currently I'm running uShare to stream videos from my home-server via DLNA to the TV. On the server there is also running a bash-script which checks if a user is connected via ssh or Samba. If this is not the case, then the server goes to hibernation-mode.

Is there any possibility to check via bash-script if the server currently streams a video to my TV? If so, I would like to see a little code example which I could include in my script which check the ssh or Samba connection.

  • I would dump the outgoing traffic from your server and sift through it for packets indicating DLNA activity. I'm not really aware of the DLNA protocol, though, so I can't help with actual code. – Joseph R. Oct 3 '13 at 11:00
  • This is an interesting idea. I'm also not very aware with it. My hope was that it can be solved by the use of grep on the process-list or something like that. Because then it would be easy to add this to the script I mentioned above. – Chrispie Oct 3 '13 at 13:13
  • @Chrispie well, dump ps xa when its not streaming v. when it is, and see if they differ... Maybe lsof as well, that's another way you might find it (if it has a network socket open). – derobert Oct 3 '13 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.