comparison packaging/linux-installer.inc.in @ 749:778382342802

Added installation of cron job.
author Sascha Wilde <wilde@intevation.de>
date Fri, 04 Jul 2014 17:13:57 +0200
parents ea8d13590cbd
children 27dd0012288a
comparison
equal deleted inserted replaced
748:fa0c99056208 749:778382342802
183 while [ "$directory" -a -z "$(ls -A "$directory")" ] ; do 183 while [ "$directory" -a -z "$(ls -A "$directory")" ] ; do
184 echo "Deleting empty directory '$directory' ..." 184 echo "Deleting empty directory '$directory' ..."
185 rmdir "$directory" 185 rmdir "$directory"
186 directory=`dirname "$directory"` 186 directory=`dirname "$directory"`
187 done 187 done
188 }
189
190 setup_cronjob()
191 {
192 # FIXME: handle case of system wide installation.
193 local tmpcrontab=`mktemp`
194 crontab -l | grep -vF "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" \
195 >"$tmpcrontab"
196 echo "$(( $RANDOM / 555 )) 12 * * * \"${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh\"" \
197 >>"$tmpcrontab"
198 crontab "$tmpcrontab"
199 rm "$tmpcrontab"
188 } 200 }
189 201
190 deinstall_certs() 202 deinstall_certs()
191 { 203 {
192 local cinst="${oldinstcfg[PREFIX]}/bin/cinst" 204 local cinst="${oldinstcfg[PREFIX]}/bin/cinst"
311 sed -i "/^PREFIX=/c\PREFIX='${instcfg[PREFIX]}'" \ 323 sed -i "/^PREFIX=/c\PREFIX='${instcfg[PREFIX]}'" \
312 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" 324 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh"
313 sed -i "/^CFGDIR=/c\CFGDIR='${instcfg_path}'" \ 325 sed -i "/^CFGDIR=/c\CFGDIR='${instcfg_path}'" \
314 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" 326 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh"
315 327
328 echo "Setting up cronjob ..."
329 setup_cronjob
330
316 echo "Writing installation configuration to: $instcfg_file ..." 331 echo "Writing installation configuration to: $instcfg_file ..."
317 write_instcfg 332 write_instcfg
318 exit 0 333 exit 0

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