Skip to content

Instantly share code, notes, and snippets.

@XDjackieXD
Last active August 29, 2015 14:19
Show Gist options
  • Save XDjackieXD/1ed0dbea22385bcd0b12 to your computer and use it in GitHub Desktop.
Save XDjackieXD/1ed0dbea22385bcd0b12 to your computer and use it in GitHub Desktop.
a modified version of isonline.sh that works with nginx-rtmp module (the -B option of rtmpdump doesn't work with it...)
#!/bin/bash
timeout 15 rtmpdump -q -v -r $1 -o /dev/null -m 5
if [[ $? -eq 124 ]]
then
if [[ ! -f /tmp/online.txt ]]
then
echo "the stream you want to watch is online!" | mail -s "Stream Online!" -a "FROM:sender@example.org" receiver@example.org
touch /tmp/online.txt
fi
else
rm -f /tmp/online.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment