[PATCH 1 of 2] Added installation of cron job
Wald Commits
scm-commit at wald.intevation.org
Fri Jul 4 17:18:38 CEST 2014
# HG changeset patch
# User Sascha Wilde <wilde at intevation.de>
# Date 1404486837 -7200
# Node ID 7783823428025b4a0bbd61d5133ae971a21cd83b
# Parent fa0c9905620808cc3378c0367967e0f5ca593993
Added installation of cron job.
diff -r fa0c99056208 -r 778382342802 packaging/linux-installer.inc.in
--- a/packaging/linux-installer.inc.in Fri Jul 04 16:27:48 2014 +0200
+++ b/packaging/linux-installer.inc.in Fri Jul 04 17:13:57 2014 +0200
@@ -187,6 +187,18 @@
done
}
+setup_cronjob()
+{
+ # FIXME: handle case of system wide installation.
+ local tmpcrontab=`mktemp`
+ crontab -l | grep -vF "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" \
+ >"$tmpcrontab"
+ echo "$(( $RANDOM / 555 )) 12 * * * \"${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh\"" \
+ >>"$tmpcrontab"
+ crontab "$tmpcrontab"
+ rm "$tmpcrontab"
+}
+
deinstall_certs()
{
local cinst="${oldinstcfg[PREFIX]}/bin/cinst"
@@ -313,6 +325,9 @@
sed -i "/^CFGDIR=/c\CFGDIR='${instcfg_path}'" \
"${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh"
+echo "Setting up cronjob ..."
+setup_cronjob
+
echo "Writing installation configuration to: $instcfg_file ..."
write_instcfg
exit 0
More information about the Trustbridge-commits
mailing list