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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. EMAIL_ENABLED="yes"
  8. EMAIL_TO="georgi@unixsol.org" # !!! Change this !!!
  9. EMAIL_FROM="georgi@unixsol.org" # !!! Change this !!!
  10. EMAIL_SUBJECT_PREFIX="[tsdecrypt]"
  11. EMAIL_PROGRAM="/usr/sbin/sendmail -t -i"
  12. LOG_ENABLED="yes"
  13. LOG_DIR="."
  14. LOG_FILE="$LOGDIR/notify.${_IDENT}.notify.log"
  15. # Environmental vars that are set by the calling process (tsdecrypt):
  16. # _TS Unix timestamp of the event.
  17. # _IDENT tsdecrypt ident (--ident parameter).
  18. # _MESSAGE_ID Event message id (For example START, STOP, etc...).
  19. # _MESSAGE_TEXT Event message text. Human readable event message.
  20. # _MESSAGE_MSG Event message id lower cased and "_" is replaced with " "
  21. export PATH="/bin:/usr/bin:/usr/local/bin"
  22. export LC_ALL=C
  23. if [ -z "${_IDENT}" -o -z "${_TS}" ]
  24. then
  25. echo "This script must be run from tsdecrypt."
  26. echo "In order for tsdecrypt to run this script use --ident and --notify-prg options."
  27. echo
  28. echo "Example:"
  29. echo " tsdecrypt --ident SOURCE/CHANNEL --notify-program ./notify-script.example --camd-server x.x.x.x"
  30. echo
  31. exit 1
  32. fi
  33. if [ "$LOG_ENABLED" = "yes" ]
  34. then
  35. LOG_DATE="$(date +%F\ %T\ %z -d @${_TS})"
  36. printf "%s | %s | %-16s | %s\n" \
  37. "$LOG_DATE" \
  38. "${_IDENT}" \
  39. "${_MESSAGE_ID}" \
  40. "${_MESSAGE_TEXT}" \
  41. >> $LOG_DIR/$LOG_FILE
  42. fi
  43. if [ "$EMAIL_ENABLED" = "yes" ]
  44. then
  45. (
  46. echo "To: <$EMAIL_TO>"
  47. echo "From: <$EMAIL_FROM>"
  48. echo "Return-Path: <$EMAIL_FROM>"
  49. echo "Subject: $EMAIL_SUBJECT_PREFIX ${_IDENT} ${_MESSAGE_MSG}"
  50. echo "X-IDENT: ${_IDENT}"
  51. echo "X-MSG-ID: ${_MESSAGE_ID}"
  52. echo "X-Mailer: tsdecrypt"
  53. echo
  54. echo "${_IDENT} ${_MESSAGE_TEXT}"
  55. ) | $EMAIL_PROGRAM
  56. fi