changeset 749:778382342802

Added installation of cron job.
author Sascha Wilde <wilde@intevation.de>
date Fri, 04 Jul 2014 17:13:57 +0200
parents fa0c99056208
children 27dd0012288a
files packaging/linux-installer.inc.in
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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

http://wald.intevation.org/projects/trustbridge/