Guest User

detect clear rtp stream for sfr neufbox

a guest
Feb 10th, 2011
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.21 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -ne 3 ]         # si le nombre de paramètres n'est pas 3
  4. then                    # affiche l'usage
  5.     echo -n "\n"
  6.     echo "Ce script scanne les flux multicast RTP et renvoi ses resultats dans un fichier"
  7.     echo "en utilisant mcfirst,dumprtp et dvbsnoop "
  8.     echo -n "\n"
  9.     echo "Usage: $0 <ip> <port> <fichier de destination>"
  10.     echo -n "\n"
  11.     exit 1
  12. fi
  13.  
  14. IP=$1
  15. PORT=$2
  16. F_DEST=$3
  17.  
  18. #IP="233.136.0."
  19. #PORT="7500"
  20.  
  21. for i in {1..254}
  22. do
  23.    echo "test de ${IP}${i}"
  24.    NB_LINE=`mcfirst ${IP}${i} ${PORT} -t 2|wc -l`
  25.    echo "$NB_LINE lignes trouvées"
  26.    if [ $NB_LINE -ne 2 ]  
  27.    then
  28.     echo "test de cryptage de ${IP}${i}"
  29.     NB_NONCRYPT=`dumprtp ${IP}${i} ${PORT}|dvbsnoop -s ts -N 10 -ph 0 -crc -if - |grep 'transport_scrambling_control: 0'|wc -l`
  30.     echo $NB_NONCRYPT
  31.     if [ $NB_NONCRYPT -ne 10 ]
  32.     then
  33.      echo "dommage, crypté"
  34.      echo "================================"
  35.     else
  36.      echo "en clair !"
  37.      echo "écriture de ${IP}${i} dans la liste des chaines"
  38.      echo "rtp://@${IP}${i}:${PORT}" >> ${F_DEST}
  39.      echo "================================"
  40.     fi
  41.    else
  42.     echo "pas assez de lignes, rien a faire"
  43.     echo "================================="
  44.    fi
  45.    sleep 3
  46. done
Add Comment
Please, Sign In to add comment