From a2ffe2d9a81fc79f18ec00a9d9ad2bf23bb15fb9 Mon Sep 17 00:00:00 2001
From: pierreozoux <pierre@ozoux.net>
Date: Tue, 10 Mar 2015 16:23:49 +0000
Subject: [PATCH] Make clearer the need for root access.

---
 README.md                | 4 ++--
 scripts/create_vultr.sh  | 1 +
 scripts/destroy_vultr.sh | 3 +++
 scripts/start.sh         | 1 +
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index b72b110..b14b0c0 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ There is a script that provision 2 VMs on Vutlr for tests purpose.
 
 ```
 export VULTR_API_KEY=
-./scripts/start.sh #need root access to modify your /etc/hosts
+./scripts/start.sh
 ssh root@server.test
 cd /data/indiehosters
 ./tests/start.sh
@@ -28,7 +28,7 @@ reboot
 ssh root@server.test
 ./tests/stop.sh
 exit
-./scripts/stop.sh #need root access to modify your /etc/hosts
+./scripts/stop.sh
 ```
 
 Most of the tests are "visual", but by reading them, it gives you an idea on how to start and stop services.
diff --git a/scripts/create_vultr.sh b/scripts/create_vultr.sh
index 640d453..ebafc81 100755
--- a/scripts/create_vultr.sh
+++ b/scripts/create_vultr.sh
@@ -37,6 +37,7 @@ do
   fi
 done
 
+echo Writing $LABEL to /etc/hosts file, needs your root password:
 sudo -- sh -c "echo $IP $LABEL \#$SUBID >> /etc/hosts"
 
 while :
diff --git a/scripts/destroy_vultr.sh b/scripts/destroy_vultr.sh
index 3ca17c7..77808aa 100755
--- a/scripts/destroy_vultr.sh
+++ b/scripts/destroy_vultr.sh
@@ -2,6 +2,9 @@
 
 LABEL=$1
 SUBID=`cat /etc/hosts | grep $LABEL | cut -d# -f2`
+
+echo Writing $LABEL to /etc/hosts file, needs your root password:
 sudo sed -i "/$LABEL/ d" /etc/hosts
+
 curl -d SUBID=$SUBID https://api.vultr.com/v1/server/destroy\?api_key\=$VULTR_API_KEY
 
diff --git a/scripts/start.sh b/scripts/start.sh
index 2cc5540..98ef30a 100755
--- a/scripts/start.sh
+++ b/scripts/start.sh
@@ -25,6 +25,7 @@ echo "We'll now modify your /etc/hosts to add the test application name"
 applications=( `cat $ROOT_DIR/SUPPORTED_APPLICATIONS` )
 for application in "${applications[@]}"
 do
+  echo Writing $LABEL to /etc/hosts file, needs your root password:
   sudo -- sh -c "echo $IP $application.test  >> /etc/hosts"
 done
 
-- 
GitLab