During the day, stop the Synology Surveillance Station Live Broadcast Feature, either manually or via the API.
Set the variable "forceStreamShutdown" to "true" in the configuration file, in-situ, either manually or via an override script.
Desired effect:
Stream should stop and it should not restart again until either/both of the above items are returned to their original states.
Actual result:
The stream may come back on for a few minutes until the next run of the script kicks in.
Cause:
The currently-running run of the script will detect, via the YouTube API, that the stream is down. It will retry and then exhaust all of its retries. Then it will bounce the stream, thinking that it needs a bounce to fix a stream glitch.
Reason:
The CrowCam.sh code starts its script by checking to see if the Live Broadcast feature is on or not, then after it's sure the stream is supposed to be on, THEN it checks to see if the stream is having any problems.
If I externally change the status of the stream while the script is checking for problems, and it doesn't yet have the updated value of "forceStreamShutdown=true" in memory, then it dutifully bounces the stream.
To do:
See if the correct code flow would be to re-check to see if the stream is up, one last time, before making it be up.
Investigate if the same applies in the opposite direction (for going down instead of up). I don't think so but rethink it.
Steps:
Desired effect:
Actual result:
Cause:
Reason:
To do: