# HG changeset patch # User Sascha Wilde # Date 1404812182 -7200 # Node ID 406bf18ee6337d80e0fcff0d5079f72373a58728 # Parent 9f0ad4bab175525283ce5a47963e855747a83479# Parent b39f369523fb91eb5e223723cd45262f007c4d5f Merged diff -r b39f369523fb -r 406bf18ee633 packaging/linux-installer.inc.in --- a/packaging/linux-installer.inc.in Mon Jul 07 18:55:51 2014 +0200 +++ b/packaging/linux-installer.inc.in Tue Jul 08 11:36:22 2014 +0200 @@ -199,15 +199,28 @@ setup_cronjob() { - # FIXME: handle case of system wide installation. local tmpcrontab=`mktemp` - crontab -l | grep -vF "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" \ - >"$tmpcrontab" + + if [ $SYSINST -eq 1 -a "${SUDO_USER+X}" ] ; then + local crontabopt="-u $SUDO_USER" + else + local crontabopt='' + fi + if [ "$1" != "deinstall" ] ; then - echo "$(( $RANDOM / 555 )) 12 * * * \"${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh\"" \ + local trustbridge_tray_starter="${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" + else + local trustbridge_tray_starter="${oldinstcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" + fi + + crontab $crontabopt -l | \ + grep -vF "$trustbridge_tray_starter" \ + >"$tmpcrontab" + if [ "$1" != "deinstall" ] ; then + echo "$(( $RANDOM / 555 )) 12 * * * \"$trustbridge_tray_starter\"" \ >>"$tmpcrontab" fi - crontab "$tmpcrontab" + crontab $crontabopt "$tmpcrontab" rm "$tmpcrontab" } @@ -341,8 +354,6 @@ echo "Preparing trustbridge-tray-starter ..." sed -i "/^PREFIX=/c\PREFIX='${instcfg[PREFIX]}'" \ "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" -sed -i "/^CFGDIR=/c\CFGDIR='${instcfg_path}'" \ - "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" echo "Setting up cronjob ..." setup_cronjob diff -r b39f369523fb -r 406bf18ee633 ui/trustbridge-tray-starter.sh --- a/ui/trustbridge-tray-starter.sh Mon Jul 07 18:55:51 2014 +0200 +++ b/ui/trustbridge-tray-starter.sh Tue Jul 08 11:36:22 2014 +0200 @@ -1,7 +1,7 @@ #!/bin/bash PREFIX="" -CFGDIR="" +CFGDIR="${XDG_CONFIG_HOME:-$HOME/.config}/BSI" TBCMD="trustbridge --tray" XSET=/usr/bin/xset CONFIG="$CFGDIR/trustbridge-tray-starter.cfg"