Skip to content

Commit

Permalink
Update up.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Aug 3, 2024
1 parent 306d7f0 commit 9f5adff
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/aws/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ function importSshKey()

function addPort(){
aws ec2 authorize-security-group-ingress \
--group-name $groupName \
--protocol tcp \
--port $1 \
--cidr 0.0.0.0/0
--group-name $groupName \
--protocol tcp \
--port $1 \
--cidr 0.0.0.0/0
}

function addUDPPort() {
aws ec2 authorize-security-group-ingress \
--group-name $groupName \
--protocol udp \
--port $1 \
--cidr 0.0.0.0/0
--group-name $groupName \
--protocol udp \
--port $1 \
--cidr 0.0.0.0/0
}

function createSecurityGroups(){
aws ec2 create-security-group \
--group-name $groupName \
--description "luftballons security group"
--group-name $groupName \
--description "luftballons security group"
if [ -z "$portConfigArray" ]; then
portConfigArray="8080:80,8443:443,2022:22"
fi
Expand All @@ -82,11 +82,11 @@ function createEc2(){
image="ami-0750fb43a63427eff"
#image="ami-01e5ff16fd6e8c542"
aws ec2 run-instances \
--count 1 \
--image-id $image \
--instance-type t2.micro \
--key-name $keyname \
--security-groups $groupName
--count 1 \
--image-id $image \
--instance-type t2.micro \
--key-name $keyname \
--security-groups $groupName
}

function findData(){
Expand All @@ -105,12 +105,12 @@ function getValueByKeyword(){
}

function usage {
echo "script usage: $(basename \$0 aws up) [-n ssh key name] [-p] [-a change key name, instance name, and group name]" >&2
echo 'Start Luftballon.'
echo ' -n Change SSH key name on AWS'
echo ' -a Change SSH key name, instance name, and group name'
echo ' -p Use stored port Numbers instead of the default port number.'
exit 1
echo "script usage: $(basename \$0 aws up) [-n ssh key name] [-p] [-a change key name, instance name, and group name]" >&2
echo 'Start Luftballon.'
echo ' -n Change SSH key name on AWS'
echo ' -a Change SSH key name, instance name, and group name'
echo ' -p Use stored port Numbers instead of the default port number.'
exit 1
}

function up {
Expand Down

0 comments on commit 9f5adff

Please sign in to comment.