-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
- Loading branch information
1 parent
125f9d8
commit aef3e7b
Showing
50 changed files
with
1,105 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/test | ||
/experiment | ||
|
||
#confs | ||
/vpn/conf/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
manageConfigPath=$(pwd) | ||
|
||
usage() { | ||
echo "Usage: $0 credential [command]" | ||
echo "Commands:" | ||
echo " aws - Execute an AWS command" | ||
echo " sshConfigManager - An interface that manages SSH configurations, allowing creation, updating, and deletion of SSH configuration entries" | ||
exit 1 | ||
} | ||
|
||
# Check if at least one argument is provided | ||
if [ $# -eq 0 ]; then | ||
usage | ||
fi | ||
|
||
# Execute the appropriate command | ||
case "$1" in | ||
aws) | ||
source $manageConfigPath/src/aws/load.sh | ||
awsDriver "${@:2}" | ||
;; | ||
sshConfigManager) | ||
source $manageConfigPath/src/utils/load.sh | ||
configDriver "${@:2}" | ||
;; | ||
*) | ||
echo "Error: Invalid command." | ||
usage | ||
;; | ||
esac |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# AWS EC2 Management Script | ||
|
||
This script is designed to simplify the management of AWS EC2 instances. It provides easy-to-use commands for initializing and deleting EC2 instances. | ||
|
||
## Usage | ||
|
||
This script supports two main commands: init and delete. | ||
|
||
### Command: init | ||
|
||
The init command verifies the AWS CLI installation, checks for the existence of an SSH key, and defines functions for importing an SSH key and adding ports in AWS EC2. | ||
|
||
```bash | ||
./driver.sh init [additional options] | ||
``` | ||
|
||
Options for init: | ||
|
||
- -n [ssh key name]: Specify a name for the SSH key on AWS. | ||
- -a [balloon name]: Change the SSH key name, instance name, and group name, based on the provided balloon name. | ||
- -p: Use stored port numbers instead of the default port number. | ||
|
||
### Command: delete | ||
|
||
The delete command deletes an AWS EC2 instance and its related resources, identified by a given "balloon name". It also handles cleanup tasks such as removing SSH tunnels and deleting security keys. | ||
|
||
```bash | ||
./driver.sh delete [balloon name] | ||
``` | ||
|
||
### Command: stop | ||
|
||
The stop command stops a specified AWS EC2 instance and removes its associated SSH tunnel. | ||
|
||
```bash | ||
./driver.sh stop [balloon name] | ||
``` | ||
|
||
### Command: restart | ||
|
||
The restart command restarts a specified Amazon EC2 instance, updates its IP address, and opens a new SSH tunnel to it. | ||
|
||
```bash | ||
./driver.sh restart [balloon name] | ||
``` | ||
|
||
### Help | ||
|
||
To view the usage instructions, use the following command: | ||
|
||
```bash | ||
./driver.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.