summaryrefslogtreecommitdiffstats
path: root/scripts/calcurse-upgrade
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-05-23 16:24:02 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-23 16:31:02 +0200
commit7bec0d47ee2b4a0438e83c15dd152e531e334a46 (patch)
tree41e2ff3e7d60e0a28c387740c42df6c9be99b9c8 /scripts/calcurse-upgrade
parent61472a32cdb3e538f954ceb2656d0c41b4cd0b9d (diff)
downloadcalcurse-7bec0d47ee2b4a0438e83c15dd152e531e334a46.tar.gz
calcurse-7bec0d47ee2b4a0438e83c15dd152e531e334a46.zip
scripts/calcurse-upgrade: Add a "--config" option
This allows for specifying an alternate configuration file which is useful if you use a non-default data directory. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'scripts/calcurse-upgrade')
-rw-r--r--scripts/calcurse-upgrade11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/calcurse-upgrade b/scripts/calcurse-upgrade
index 1fc481f..e04b2f9 100644
--- a/scripts/calcurse-upgrade
+++ b/scripts/calcurse-upgrade
@@ -2,7 +2,16 @@
set -e
-CONFFILE=$HOME/.calcurse/conf
+if [ "$1" = "--config" ]; then
+ CONFFILE=$2
+else
+ CONFFILE=$HOME/.calcurse/conf
+fi
+
+if [ ! -e "$CONFFILE" ]; then
+ echo "Configuration file not found: $CONFFILE" >&2
+ exit 1
+fi
if grep -q -e '^auto_save=' -e '^auto_gc=' -e '^periodic_save=' \
-e '^confirm_quit=' -e '^confirm_delete=' -e '^skip_system_dialogs=' \