#!/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}" } } function delete_vpc { local vpc_name="${1}" print_in_color "${COLOR_RED}" "Delete ${vpc_name}" /opt/two/bin/vpc -action "delete" -name "${vpc_name}" }