add check vm exist
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
338f1d371a
commit
7a52ee8af2
1 changed files with 11 additions and 0 deletions
11
lib/qemu.sh
11
lib/qemu.sh
|
|
@ -4,6 +4,17 @@
|
|||
. ./lib/colors.sh
|
||||
. ./lib/db.sh
|
||||
|
||||
function check_qemu_exist {
|
||||
local vm_name="${1}"
|
||||
|
||||
print_in_color "${COLOR_GREY}" "Check in db if ${vm_name} exist"
|
||||
check_in_db "vm" "${vm_name}"
|
||||
[ "$?" -eq "0" ] || return 1
|
||||
ps aux | grep -v grep | grep "${vm_name}" > /dev/null || return 1
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
function create_tap {
|
||||
local tap_id="${1}"
|
||||
local bridge_name="${2}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue