[PATCH 1 of 3] (issue54) use su to launch application as user after system wide installation

Wald Commits scm-commit at wald.intevation.org
Wed Sep 10 16:41:40 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1410358700 -7200
# Node ID 4e93a87d89eb76c793f16c500add8c7f71323958
# Parent  51b97ebc5b06a08257096c4d5e139bb293848344
(issue54) use su to launch application as user after system wide installation

diff -r 51b97ebc5b06 -r 4e93a87d89eb packaging/linux-installer.inc.in
--- 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
 }


More information about the Trustbridge-commits mailing list