From 40795540968ac2debd01a533e45b9acc5387384e Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Fri, 24 Jan 2014 07:02:22 -0500 Subject: [PATCH] Don't die badly when config file just isn't there. Instead, give a message in the conky output, which is the better thing to do, since the config file (at least for me) may be on a partition that hasn't been mounted. --- calendar-export.plx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/calendar-export.plx b/calendar-export.plx index f0a383f..750e09b 100755 --- a/calendar-export.plx +++ b/calendar-export.plx @@ -545,6 +545,10 @@ sub ReadConfig($) { system("/usr/bin/lockfile -r 8 $CALENDAR_LOCK_FILE"); DieLog("Failure to acquire calendar lock on $CALENDAR_LOCK_FILE") unless ($? == 0); +if (not -r $CONFIG_FILE) { + print "\${color5}$CONFIG_FILE does not exist\n"; + exit 0; +} my $config = ReadConfig($CONFIG_FILE); $config->{scrubPrivate} = 0 if not defined $config->{scrubPrivate};