Skip to content

Commit

Permalink
check out ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroTochigi committed Feb 10, 2024
1 parent 2efebb6 commit 944a7c7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/aws/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function driver() {
restart)
restart "${@:2}"
;;
test)
test "${@:2}"
;;
*)
echo "Error: Invalid command."
awsUsage
Expand Down
1 change: 1 addition & 0 deletions src/aws/load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ source $manageConfigPath/src/aws/delete.sh
source $manageConfigPath/src/aws/stop.sh
source $manageConfigPath/src/aws/restart.sh
source $manageConfigPath/src/aws/driver.sh
source $manageConfigPath/src/aws/test.sh

1 change: 0 additions & 1 deletion src/aws/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function stop(){

publicIp=$(waitForOutput "getLatestIpAddress $instanceId")
#treehouses sshtunnel remove host root@$publicIp
echo "Delete sshtunnel of root@$publicIp"

aws ec2 stop-instances --instance-ids $instanceId

Expand Down
25 changes: 25 additions & 0 deletions src/aws/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

#BASE=$HOME
BASE=/home/pi

function test(){
balloonName=$(setBalloonName "$1")
if ! isBalloonNameValid "$balloonName"; then
echo "Please provide a valid balloon name"
exit 1
fi

instanceId=$(getValueByAttribute $balloonName instanceId)

if [ "$instanceId" = "null" ]; then
echo "$balloonName is already deleted"
exit 1
fi

publicIp=$(getValueByAttribute $balloonName publicIp)

echo $publicIp


}

0 comments on commit 944a7c7

Please sign in to comment.