Modernisation master
authorJoey Schulze <joey@infodrom.org>
Tue, 26 Sep 2023 06:32:48 +0000 (08:32 +0200)
committerJoey Schulze <joey@infodrom.org>
Tue, 26 Sep 2023 06:32:48 +0000 (08:32 +0200)
mail-calendar

index e633ed2..64e2e1b 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 #   mail-calendar - send information about historical dates
 #! /bin/sh
 
 #   mail-calendar - send information about historical dates
-#   Copyright (c) 2002,3  Martin Schulze <joey@infodrom.org>
+#   Copyright (c) 2002,3,18  Joey Schulze <joey@infodrom.org>
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   along with this program; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 
 #   along with this program; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 
-#   http://cvs.infodrom.org/calendar/mail-calendar?cvsroot=infodrom
-#   :pserver:anonymous@cvs.infodrom.org:/var/cvs/infodrom co calendar/mail-calendar
-#  
-#   $Id$
+#   git clone git://git.infodrom.org/infodrom/calendar
 
 #
 #   Important note: this program requires the FreeBSD version of
 
 #
 #   Important note: this program requires the FreeBSD version of
@@ -78,19 +75,20 @@ de_DE)
        opt_dateform="%d. %B"
 esac
 
        opt_dateform="%d. %B"
 esac
 
-secs=$[ $opt_advance * 86400 ]
+secs=$(( $opt_advance * 86400 ))
 
 c_date=`date -d now+${secs}seconds +%m%d`
 s_date=`LANG=$opt_lang date -d now+${secs}seconds "+$opt_dateform"`
 
 
 c_date=`date -d now+${secs}seconds +%m%d`
 s_date=`LANG=$opt_lang date -d now+${secs}seconds "+$opt_dateform"`
 
-tmp=`tempfile`
+tmp=$(mktemp)
 trap 'rm -f $tmp' INT EXIT
 
 trap 'rm -f $tmp' INT EXIT
 
-LC_CTYPE=en_US.ISO-8859-1 calendar -l 0 -w 0 -t $c_date|iconv -c -f utf8 -t iso8859-1 > $tmp
+LC_CTYPE=en_US.ISO-8859-1 calendar -l 0 -e 0 -w -t $c_date|iconv -c -f utf8 -t iso8859-1 > $tmp
 
 if [ -s $tmp ]
 then
     (
 
 if [ -s $tmp ]
 then
     (
+       echo "From: $(getent passwd $LOGNAME|cut -d: -f5|cut -d, -f1) <$LOGNAME@$(hostname -f)>"
        echo "Subject: $opt_subject $s_date"
        echo "To: $opt_to"
        echo "Content-Type: text/plain; charset=iso-8859-1"
        echo "Subject: $opt_subject $s_date"
        echo "To: $opt_to"
        echo "Content-Type: text/plain; charset=iso-8859-1"