diff --git a/README.md b/README.md index a09be9008e87591a3756cc9589617586af29e0d6..01e716dd257546ee51ad3511d615f9ba1de0c496 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ There is a script that provision 2 VMs on Vutlr for tests purpose. /!\ This is still in dev, use it at your own risk /!\ ``` -export VULTR_API_KEY= -./script/start.sh #need root access to modify your /etc/hosts +#need root access to modify your /etc/hosts: +sudo export VULTR_API_KEY= abcd ./scripts/start.sh ssh root@server.test cd /data/indiehosters ./tests/start.sh diff --git a/scripts/create_vultr.sh b/scripts/create_vultr.sh index 45b9c7779fdae258d5b0ee04b6efd041e7abec9b..eeff000af96513f82f3915a6d3c6ddf549946974 100755 --- a/scripts/create_vultr.sh +++ b/scripts/create_vultr.sh @@ -18,9 +18,14 @@ function valid_ip() LABEL=$1 +echo Label: $LABEL +echo API key: $VULTR_API_KEY + SSHKEYID=`curl -s https://api.vultr.com/v1/sshkey/list\?api_key\=$VULTR_API_KEY | cut -d\" -f2` +echo Got your ssh key ID $SSHKEYID: SUBID=`curl -s -d "DCID=24&VPSPLANID=29&OSID=179&label=$LABEL&SSHKEYID=$SSHKEYID" https://api.vultr.com/v1/server/create\?api_key\=$VULTR_API_KEY | cut -d\" -f4` +echo Got your SUB ID $SUBID: while : do