Customize repeater welcome message based on time

You may find interesting that your repeater says “Good morning” or “Good evening”, depending of the current time .

This is installable by few simple setup steps.

Copy the file RepeaterLogic.tcl in a subdirectory local

cd /usr/share/svxlink/events.d/
sudo mkdir local
cp RepeaterLogic.tcl ./local/RepeaterLogic.tcl

Edit the file and modify the RepeaterLogic.tcl repeater_up function. We choose to tell “Good evening” after 18 pm and before 3 am. Outside this period, the repeater say “Hello”.

sudo nano /usr/share/svxlink/events.d/local/RepeaterLogic.tcl

proc repeater_up {reason} {
  global mycall;
  global active_module;
  variable repeater_is_up;
 
  set repeater_is_up 1;
 
  if {($reason != "SQL_OPEN") && ($reason != "CTCSS_OPEN") &&
      ($reason != "SQL_RPT_REOPEN")} {
    set now [clock seconds];
    if {$now-$Logic::prev_ident < $Logic::min_time_between_ident} {
      return;
    }
    set Logic::prev_ident $now;
 
set heure [clock format [clock seconds] -format "%H%M"]
if {  ($heure >= 1800) || ($heure <= 0300) } {
    playMsg "SVXCard" "goodevening";
    puts "Good Evening";  # for a log trace
} else {
    playMsg "SVXCard" "goodmorning";
    puts "Hello";   # for a log trace
}
 playMsg "SVXCard" "welcome";
 
#    spellWord $mycall;
#    playMsg "Core" "repeater";
#    playSilence 250;
 
    if {$active_module != ""} {
      playMsg "Core" "active_module";
      playMsg $active_module "name";
    }
  }
}