add vpc
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
aaf479f86a
commit
6b9c5e64b8
4 changed files with 65 additions and 8 deletions
24
agent.sh
24
agent.sh
|
|
@ -1,10 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
[[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://git.g3e.fr/H6N/tools/raw/branch/main/libs/shflags)"
|
||||
|
||||
. ./lib/vpc.sh
|
||||
|
||||
function start_vm {
|
||||
[[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://git.g3e.fr/H6N/tools/raw/branch/main/libs/shflags)"
|
||||
DRY_RUN="1"
|
||||
SIMULATION="1"
|
||||
|
||||
function start_vm {
|
||||
DEFINE_string 'interface' 'eno1' 'KVM Interface' 'i'
|
||||
DEFINE_string 'vxlan_id' '-' 'VXLAN ID' 'v'
|
||||
DEFINE_string 'gateway_ip' '-' 'Gatewat IP' 'g'
|
||||
|
|
@ -44,7 +47,19 @@ function start_vm {
|
|||
echo
|
||||
echo
|
||||
|
||||
create_vpc "${FLAGS_vpc_name}"
|
||||
create_vpc "${FLAGS_dryrun}" "${FLAGS_vpc_name}"
|
||||
}
|
||||
|
||||
function stop_vm {
|
||||
DEFINE_string 'vm_name' '-' 'VM NAME' 'm'
|
||||
DEFINE_string 'vpc_name' '-' 'VPC NAME' 'c'
|
||||
DEFINE_boolean 'dryrun' false 'Enable dry-run mode' 'd'
|
||||
|
||||
FLAGS "$@" || exit $?
|
||||
eval set -- "${FLAGS_ARGV}"
|
||||
|
||||
delete_vpc "${FLAGS_vpc_name}"
|
||||
|
||||
}
|
||||
|
||||
function main {
|
||||
|
|
@ -55,6 +70,9 @@ function main {
|
|||
"StartVm")
|
||||
start_vm "$@"
|
||||
;;
|
||||
"StopVm")
|
||||
stop_vm "$@"
|
||||
;;
|
||||
*)
|
||||
echo "action : ${fonction} not known !"
|
||||
echo "avalable action :"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue