Ngnix RTMP Module exec_publish & exec_publish_done with bash script to send data on mysql db -
i having problems implement exec_publish
, exec_publish_done
, acquiring info stream key database. idea run online.sh
file when stream key active , run offline.sh
file when stream done publish. also, not sure written 2 .bash script files correct. searched online on 10 days info. but, no luck. mysql command correct. when run command directly on ubuntu server (14.04 , 16.04) terminal works fine without error.
mysql command update online db:
mysql -u streams -pdbpass streams -e "update stream_users set user_keystatus = 1 stream_users. id = 2"
mysql command update offline db:
mysql -u streams -pdbpass streams -e "update stream_users set user_keystatus = 0 stream_users. id = 2"
mysql command update database data (user_keystatus
) 1
, 0
file: online.sh
#!/bin/bash mysql -u streams -pdbpass streams -e "update stream_users set user_keystatus = 1 stream_users. id = 2"
file: offline.sh
#!/bin/bash mysql -u streams -pdbpass streams -e "update stream_users set user_keystatus = 0 stream_users. id = 2"
so, want know how can run 2 .sh files when stream key starts reprinting , when publish end.
i using nginx rtmp module github: https://github.com/arut/nginx-rtmp-module
directive info here at: https://github.com/arut/nginx-rtmp-module/wiki/directives
i hope system configuration provided sufficient. know how run 2 .sh
files properly.
Comments
Post a Comment