summaryrefslogtreecommitdiff
path: root/utils/rhrd-schedules
diff options
context:
space:
mode:
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;