validated calling out to logname
[feisty_meow.git] / scripts / schedule / generate_reminders.pl
index e5177c6b9eb1980fb916fe9519492d4ec9fd5b88..0769ddf80f03b416e862e3454966803e618d37bd 100644 (file)
@@ -26,7 +26,7 @@
 # The day must be a number, followed by a space.  Anything after that
 # space is considered the description of the event.
 
-use Env qw(CLOUD_DIR TMP);
+use Env qw(CLOUD_BASE TMP);
 
 ##############
 
@@ -34,16 +34,16 @@ use Env qw(CLOUD_DIR TMP);
 local($TEMPO_FILE) = `mktemp "$TMP/zz_reminder.XXXXXX"`;
 chop($TEMPO_FILE);
 
-local($USERNAME) = "$REPLYTO";
-if (! $USERNAME) { $USERNAME="fred" }
+local($USER_NAME) = "$REPLYTO";
+if (! $USER_NAME) { $USER_NAME="fred" }
 
-#print "TEMPO is $TEMPO_FILE ; USER is $USERNAME ; \n";
+#print "TEMPO is $TEMPO_FILE ; USER is $USER_NAME ; \n";
 
 local($CAL_FILE);
 if (! $CAL_FILE) {
 #  print "the CAL_FILE variable is not set.\n";
 #  print "defaulting it to a value that probably does not suit you.\n";
-  $CAL_FILE = "$CLOUD_DIR/database/calendar.dat";
+  $CAL_FILE = "$CLOUD_BASE/magic_cabinet/lists/calendar.dat";
 }
 
 #print "calfile is $CAL_FILE\n";
@@ -133,8 +133,8 @@ while (<DATES>) {
 # send mail here if there's anything to say.
 if (! -z $TEMPO_FILE) {
   # there are some alerts in there.
-#print "will run: system(\"mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USERNAME <$TEMPO_FILE\");\n";
-  system("mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USERNAME <$TEMPO_FILE");
+#print "will run: system(\"mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USER_NAME <$TEMPO_FILE\");\n";
+  system("mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USER_NAME <$TEMPO_FILE");
 }
 
 unlink $TEMPO_FILE;