diff --git a/README.md b/README.md index b72b11017fd95051dd668129ea86d48e0090c09e..b14b0c0ccda8609b1df510425b8d01aec2397060 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 640d45374e3aa2b6080e7684454c9ec5cb529d64..ebafc81f847187fd06c4f6281ea97d9e8aeb76d6 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 3ca17c7ff329228dc926092415f4686ac54913a4..77808aa0fd6a4ddea11f6dcbb15aa2020b68d978 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 2cc5540e8e7b88fb1cfdcb3a585352a00effb21e..98ef30aa42d04d33f59f76f9294a65a02d42c03b 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