I'm sure there are other better ways to get the same result, but this is the method I devised with my limited knowledge. Another method could be to actually have it load anew with each page refresh. Keep in mind my MOTD is just to provide internal agents with a source of light entertainment rather than anything informative.
default contents of /opt/otrs/Kernel/Output/HTML/Standard/Motd.dtl:
Code: Select all
<div class="WidgetSimple" id="MessageOfTheDayBox">
<div class="Header">
<h2 class="Center">$Text{"Message of the Day"}</h2>
</div>
<div class="Content">
<p>This is the message of the day. You can edit this in Kernel/Output/HTML/Standard/Motd.dtl.</p>
</div>
</div>
fortune: http://en.wikipedia.org/wiki/Fortune_%28Unix%29
cron: http://en.wikipedia.org/wiki/Cron
apt-get install fortune (this applies to Debian. see documentation for your particular distro for how to install)
touch otrsmotd
chmod 755 otrsmod
with your favorite text editor put the following into this file:
Code: Select all
echo "<div class="WidgetSimple" id="MessageOfTheDayBox"> <div class="Header"> <h2 class="Center">$Text{"Message of the Day"}</h2></div><div class="Content"><p>$(/usr/games/fortune -a -e)</p> </div></div>" > /opt/otrs/Kernel/Output/HTML/Standard/Motd.dtl
mv otrsmotd /opt/otrs/bin/ - this is the dir i chose. where you place the file is up to you just as long as the crontab below matches up.
cron -e - this will drop you into the crontab editor. add the following line and hit ctrl-x once finished
Code: Select all
*/1 * * * * /opt/otrs/bin/otrsmotd