From 8f72f604a89bb3ff3dba82521dd9fc474208f189 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Fri, 1 Jan 2016 22:39:55 +0100 Subject: [PATCH] Only hardcode path to config if variable isn't set That way we can just set the variable in the crontab file (or users environment), and do not need to change cronscript (eg. when run on the security archive) --- config/debian/cronscript | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/debian/cronscript b/config/debian/cronscript index b9cdf252..2418d79a 100755 --- a/config/debian/cronscript +++ b/config/debian/cronscript @@ -47,8 +47,12 @@ shopt -s extglob export LANG=C.UTF-8 export LC_ALL=C.UTF-8 -# import the general variable set. -export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars +# If run from crontab, CONFIGDIR will point to the correct dir +# where we find the vars file +configdir=${configdir:-"/srv/ftp-master.debian.org/dak/config/debian"} +# import the general variable set. (This will overwrite configdir, but +# it is expected to have the same value) +export SCRIPTVARS=${configdir}/vars . $SCRIPTVARS # One arg please -- 2.39.2