summaryrefslogtreecommitdiff
path: root/utils/rhrd-schedules
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-03-08 16:14:52 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-03-08 16:14:52 (GMT)
commitb05d04535359960bf7ba3e431bd2252fd12a8817 (patch)
tree238033c26626fc15fe0b08c6f10242cf696c2a66 /utils/rhrd-schedules
parent6d15044c29517c989205a97a48c3325af06c4bf9 (diff)
reloading logs if it is from today
Diffstat (limited to 'utils/rhrd-schedules')
-rwxr-xr-xutils/rhrd-schedules22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/rhrd-schedules b/utils/rhrd-schedules
index 2b826e9..4e38872 100755
--- a/utils/rhrd-schedules
+++ b/utils/rhrd-schedules
@@ -120,6 +120,27 @@ sub generate
return $errcnt;
}
+sub reload_logs
+{
+ my ($ctx, $year, $month, $day) = @_;
+
+ my @today = Date::Calc::Today();
+ if($today[0] == $year && $today[1] == $month && $today[2] == $day) {
+ if(RHRD::utils::is_rmlsend_installed() == 1) {
+ print "Reloading today's logs ";
+
+ RHRD::utils::send_rml("RL 3!", "airplay.helsinki.at");
+ print ".";
+ RHRD::utils::send_rml("RL 3!", "airplay2.helsinki.at");
+ print ".";
+
+ print " done.\n";
+ } else {
+ print "Log is from today. The playout server need to reload the log but rmlsend is not installed!\n"
+ }
+ }
+}
+
sub get
{
my ($ctx, $year, $month, $day) = @_;
@@ -472,6 +493,7 @@ if(defined $ctx) {
if($cmd eq "generate") {
if($num_args == 2 && $ARGV[1] =~ m/^(\d{4})-(\d{2})-(\d{2})$/) {
$ret = generate($ctx, $1, $2, $3);
+ reload_logs($ctx, $1, $2, $3);
} else {
print_usage();
$ret = 1;