tsdecrypt reads and decrypts CSA encrypted incoming mpeg transport stream over UDP/RTP using code words obtained from OSCAM or similar CAM server. tsdecrypt communicates with CAM server using cs378x (camd35 over tcp) protocol or newcamd protocol. https://georgi.unixsol.org/programs/tsdecrypt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

notify-script.example 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. # Example tsdecrypt notify script
  3. # Written by Georgi Chorbadzhiyski
  4. #
  5. # *** Released as PUBLIC DOMAIN ***
  6. # *** Do whatever you want with this code ***
  7. # tsdecrypt sets its stack size to 64k which is very low and
  8. # causes sendmail to segfault, so increase the stack size to 2Mb
  9. ulimit -s 2048
  10. EMAIL_ENABLED="yes"
  11. EMAIL_TO="georgi@unixsol.org" # !!! Change this !!!
  12. EMAIL_FROM="georgi@unixsol.org" # !!! Change this !!!
  13. EMAIL_SUBJECT_PREFIX="[tsdecrypt]"
  14. EMAIL_PROGRAM="/usr/sbin/sendmail -t -i"
  15. LOG_ENABLED="yes"
  16. LOG_DIR="."
  17. LOG_FILE="$LOGDIR/notify.${_IDENT}.notify.log"
  18. # Environmental vars that are set by the calling process (tsdecrypt):
  19. # _TS Unix timestamp of the event.
  20. # _IDENT tsdecrypt ident (--ident parameter).
  21. # _INPUT_ADDR Input address and port (for example 239.1.2.3:5000).
  22. # _OUTPUT_ADDR Output address and port (for example 239.9.8.7:5000).
  23. # _MESSAGE_ID Event message id (For example START, STOP, etc...).
  24. # _MESSAGE_TEXT Event message text. Human readable event message.
  25. # _MESSAGE_MSG Event message id lower cased and "_" is replaced with " "
  26. export PATH="/bin:/usr/bin:/usr/local/bin"
  27. export LC_ALL=C
  28. if [ -z "${_IDENT}" -o -z "${_TS}" ]
  29. then
  30. echo "This script must be run from tsdecrypt."
  31. echo "In order for tsdecrypt to run this script use --ident and --notify-prg options."
  32. echo
  33. echo "Example:"
  34. echo " tsdecrypt --ident SOURCE/CHANNEL --notify-program ./notify-script.example --camd-server x.x.x.x"
  35. echo
  36. exit 1
  37. fi
  38. if [ "$LOG_ENABLED" = "yes" ]
  39. then
  40. LOG_DATE="$(date +%F\ %T\ %z -d @${_TS})"
  41. printf "%s | %s | %-16s | %s\n" \
  42. "$LOG_DATE" \
  43. "${_IDENT}" \
  44. "${_MESSAGE_ID}" \
  45. "${_MESSAGE_TEXT}" \
  46. >> $LOG_DIR/$LOG_FILE
  47. fi
  48. if [ "$EMAIL_ENABLED" = "yes" ]
  49. then
  50. if [ -x $EMAIL_PROGRAM ]; then
  51. (
  52. echo "To: <$EMAIL_TO>"
  53. echo "From: <$EMAIL_FROM>"
  54. echo "Return-Path: <$EMAIL_FROM>"
  55. echo "Subject: $EMAIL_SUBJECT_PREFIX ${_IDENT} ${_MESSAGE_MSG}"
  56. echo "X-IDENT: ${_IDENT}"
  57. echo "X-MSG-ID: ${_MESSAGE_ID}"
  58. echo "X-Input: ${_INPUT_ADDR}"
  59. echo "X-Output: ${_OUTPUT_ADDR}"
  60. echo "X-Mailer: tsdecrypt"
  61. echo
  62. echo "${_IDENT} ${_MESSAGE_TEXT}"
  63. ) | $EMAIL_PROGRAM
  64. fi
  65. fi