Browse Source

clean up and comments

master
Tyler 5 months ago
parent
commit
f67b1664ce
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      ocean.sh

+ 6
- 3
ocean.sh View File

@@ -72,6 +72,7 @@ then
image="RancherOS Latest"
fi

# Select a region at random
arr[0]="nyc1"
arr[1]="nyc3"
arr[2]="ams3"
@@ -82,18 +83,20 @@ arr[6]="tor1"
rand=$[ $RANDOM % 6 ]
region=${arr[$rand]}

# Summarize next action
echo $hostname wil be $size running $image in $region

# Prompt user
read -p "Ready to create the droplet? (N/y)" -n 1 -r
echo # (optional) move to a new line
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
echo Provisioning...
echo $binarypath/doctl -v compute droplet create $hostname --region $region --image $slug --size $size --ssh-keys bb:a0:44:ab:d4:d6:eb:74:83:84:61:80:0e:ec:0d:77 --wait
# Lets throw it all together...
echo $binarypath/doctl -v compute droplet create $hostname --region $region --image $slug --size $size
$binarypath/doctl -v compute droplet create $hostname --region $region --image $slug --size $size --ssh-keys bb:a0:44:ab:d4:d6:eb:74:83:84:61:80:0e:ec:0d:77 --wait
echo "This line was added testing WorkingCopy from an iPad. Far out."
ip="`$binarypath/doctl -v compute droplet list $hostname --output json | grep -v 138.68.63.234 | jq '.[].networks.v4' | jq '.[].ip_address' | grep -v null`"
$binarypath/doctl -v compute domain records create --record-type A --record-name $1 --record-data $ip swarm.molamphy.net
sleep 3


Loading…
Cancel
Save