3 # mail-calendar - send information about historical dates
4 # Copyright (c) 2002,3 Martin Schulze <joey@infodrom.org>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20 # http://cvs.infodrom.org/calendar/mail-calendar?cvsroot=infodrom
21 # :pserver:anonymous@cvs.infodrom.org:/var/cvs/infodrom co calendar/mail-calendar
25 opt_subject="Calendar for"
32 echo "mail-calendar [-h|--help] [-l|--lang locale] [-t|--to addr] [-a|--advance days]"
68 # Add support for non-english languages/locales
71 opt_subject="Kalender für den"
75 secs=$[ $opt_advance * 86400 ]
77 c_date=`date -d now+${secs}seconds +%d.%m`
78 s_date=`LANG=$opt_lang date -d now+${secs}seconds "+$opt_dateform"`
81 trap 'rm -f $tmp' INT EXIT
83 calendar -l 0 -w 0 -t $c_date > $tmp
88 echo "Subject: $opt_subject $s_date"
91 calendar -l 0 -w 0 -t $c_date
92 ) | /usr/sbin/sendmail "$opt_to"