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 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. # _MESSAGE_ID Event message id (For example START, STOP, etc...).
  22. # _MESSAGE_TEXT Event message text. Human readable event message.
  23. # _MESSAGE_MSG Event message id lower cased and "_" is replaced with " "
  24. export PATH="/bin:/usr/bin:/usr/local/bin"
  25. export LC_ALL=C
  26. if [ -z "${_IDENT}" -o -z "${_TS}" ]
  27. then
  28. echo "This script must be run from tsdecrypt."
  29. echo "In order for tsdecrypt to run this script use --ident and --notify-prg options."
  30. echo
  31. echo "Example:"
  32. echo " tsdecrypt --ident SOURCE/CHANNEL --notify-program ./notify-script.example --camd-server x.x.x.x"
  33. echo
  34. exit 1
  35. fi
  36. if [ "$LOG_ENABLED" = "yes" ]
  37. then
  38. LOG_DATE="$(date +%F\ %T\ %z -d @${_TS})"
  39. printf "%s | %s | %-16s | %s\n" \
  40. "$LOG_DATE" \
  41. "${_IDENT}" \
  42. "${_MESSAGE_ID}" \
  43. "${_MESSAGE_TEXT}" \
  44. >> $LOG_DIR/$LOG_FILE
  45. fi
  46. if [ "$EMAIL_ENABLED" = "yes" ]
  47. then
  48. (
  49. echo "To: <$EMAIL_TO>"
  50. echo "From: <$EMAIL_FROM>"
  51. echo "Return-Path: <$EMAIL_FROM>"
  52. echo "Subject: $EMAIL_SUBJECT_PREFIX ${_IDENT} ${_MESSAGE_MSG}"
  53. echo "X-IDENT: ${_IDENT}"
  54. echo "X-MSG-ID: ${_MESSAGE_ID}"
  55. echo "X-Mailer: tsdecrypt"
  56. echo
  57. echo "${_IDENT} ${_MESSAGE_TEXT}"
  58. ) | $EMAIL_PROGRAM
  59. fi