clean vpc file
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
bb7dac65be
commit
79b73ea796
1 changed files with 2 additions and 21 deletions
23
lib/vpc.sh
23
lib/vpc.sh
|
|
@ -1,36 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
. ./lib/db.sh
|
||||
. ./lib/colors.sh
|
||||
|
||||
BINARY="/opt/two/bin/vpc"
|
||||
|
||||
function check_vpc_exist {
|
||||
local vpc_name=${1}
|
||||
|
||||
/opt/two/bin/vpc -action "check" -name "${vpc_name}"
|
||||
[ "$?" -eq "0" ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
function create_vpc {
|
||||
local vpc_name="${1}"
|
||||
|
||||
check_vpc_exist "${vpc_name}"
|
||||
[ "$?" -eq "0" ] && \
|
||||
{
|
||||
print_in_color "${COLOR_ORANGE}" "Would have create ${vpc_name}"
|
||||
} || \
|
||||
{
|
||||
/opt/two/bin/vpc -action "check" -name "${vpc_name}"
|
||||
print_in_color "${COLOR_GREEN}" "Create ${vpc_name}"
|
||||
}
|
||||
|
||||
"${BINARY}" -action "create" -name "${vpc_name}"
|
||||
}
|
||||
|
||||
function delete_vpc {
|
||||
local vpc_name="${1}"
|
||||
|
||||
print_in_color "${COLOR_RED}" "Delete ${vpc_name}"
|
||||
/opt/two/bin/vpc -action "delete" -name "${vpc_name}"
|
||||
"${BINARY}" -action "delete" -name "${vpc_name}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue