changeset 1068:4e93a87d89eb

(issue54) use su to launch application as user after system wide installation
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 10 Sep 2014 16:18:20 +0200
parents 51b97ebc5b06
children 709a7633a2c6
files packaging/linux-installer.inc.in
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/linux-installer.inc.in	Wed Sep 10 15:56:24 2014 +0200
+++ b/packaging/linux-installer.inc.in	Wed Sep 10 16:18:20 2014 +0200
@@ -254,23 +254,25 @@
     echo "      'sudo $0 -d'"
     getxt "And install it again without sudo:\n"
     echo "       $0"
+    RUNCMD="su $SUDO_USER -c "
   else
     getxt "If you want to change the certificates of all users\n"
     getxt "uninstall it with:\n"
     echo "      '$0 -d'"
     getxt "And install it again using sudo:\n"
     echo "       sudo $0"
+    RUNCMD=""
   fi
   echo "#################################################################################"
   getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge"
   if [ $UPDATE -eq 0 ]; then
     read
-    "${instcfg[PREFIX]}/bin/trustbridge" &
+    $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" &
   else
     if [ $SHOWAFTERUPDATE -eq 0 ]; then
-      "${instcfg[PREFIX]}/bin/trustbridge" --tray &
+      $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" --tray &
     else
-      "${instcfg[PREFIX]}/bin/trustbridge" &
+      $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" &
     fi
   fi
 }

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