summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-05-09 15:14:46 +0100
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-08-11 12:56:12 -0700
commit9a6300f9dfba51b4b121885c3507ac55c046ec57 (patch)
tree83f9d714009813e9e834b007d3ba5881d041634a
parentb5e92b7f0b45e378ba0d7f4325fd11a85943d0f7 (diff)
prototypes: xci: Do not require root privileges in xci-deploy
There is no good reason to run the script as root. If elevated privileges are required then we will do it on a per case basis. Change-Id: I7195fb3a0026ea20ce04e0b652dd3c1c56ca5741 Signed-off-by: Markos Chandras <mchandras@suse.de>
-rw-r--r--xci/README.rst8
-rwxr-xr-xxci/xci-deploy.sh10
2 files changed, 7 insertions, 11 deletions
diff --git a/xci/README.rst b/xci/README.rst
index 8318cdb5..6d7af0d6 100644
--- a/xci/README.rst
+++ b/xci/README.rst
@@ -148,13 +148,7 @@ set where the logs should be stored
execute sandbox script
- sudo -E ./xci-deploy.sh
-
-Warning::
-
- Please encure you always execute the sandbox script using **sudo -E**
- in order to make the environment variables you set available to the
- sandbox script or you end up with the default settings.
+ ./xci-deploy.sh
===============
User Variables
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index 718ed73c..2ce7c6b0 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -4,11 +4,13 @@ set -o nounset
set -o pipefail
#-------------------------------------------------------------------------------
-# This script must run as root
+# This script should not be run as root
#-------------------------------------------------------------------------------
-if [[ $(whoami) != "root" ]]; then
- echo "Error: This script must be run as root!"
- exit 1
+if [[ $(whoami) == "root" ]]; then
+ echo "WARNING: This script should not be run as root!"
+ echo "Elevated privileges are aquired automatically when necessary"
+ echo "Waiting 10s to give you a chance to stop the script (Ctrl-C)"
+ for x in $(seq 10 -1 1); do echo -n "$x..."; sleep 1; done
fi
#-------------------------------------------------------------------------------