prototypes: xci: Do not require root privileges in xci-deploy 91/34591/1
authorMarkos Chandras <mchandras@suse.de>
Tue, 9 May 2017 14:14:46 +0000 (15:14 +0100)
committerMarkos Chandras <mchandras@suse.de>
Thu, 11 May 2017 09:20:50 +0000 (10:20 +0100)
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>
prototypes/xci/README.rst
prototypes/xci/xci-deploy.sh

index 8318cdb..6d7af0d 100644 (file)
@@ -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
index 718ed73..2ce7c6b 100755 (executable)
@@ -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
 
 #-------------------------------------------------------------------------------