summaryrefslogtreecommitdiffstats
path: root/prototypes/xci
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-05-09 15:14:46 +0100
committerMarkos Chandras <mchandras@suse.de>2017-05-11 10:20:50 +0100
commit06326510d547fd36d87e8d75bd504a3f65b80870 (patch)
tree7b37e2fbf4a526307cdb5b5d5c8c369c3cd31fb8 /prototypes/xci
parent0eea6b8b93aa4297424f9530ed0f4b25c977bee1 (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>
Diffstat (limited to 'prototypes/xci')
-rw-r--r--prototypes/xci/README.rst8
-rwxr-xr-xprototypes/xci/xci-deploy.sh10
2 files changed, 7 insertions, 11 deletions
diff --git a/prototypes/xci/README.rst b/prototypes/xci/README.rst
index 8318cdb52..6d7af0d6e 100644
--- a/prototypes/xci/README.rst
+++ b/prototypes/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/prototypes/xci/xci-deploy.sh b/prototypes/xci/xci-deploy.sh
index 718ed73c2..2ce7c6b06 100755
--- a/prototypes/xci/xci-deploy.sh
+++ b/prototypes/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
#-------------------------------------------------------------------------------