diff options
| author | hc <hc@email.ch> | 2024-10-22 14:28:35 +0800 |
|---|---|---|
| committer | hc <hc@email.ch> | 2024-10-22 14:28:35 +0800 |
| commit | 6a874d576a26249db1a526876c2b0487d0e0c977 (patch) | |
| tree | 54592ed8bc0310261c7420f2ec259108fbb0faea /others | |
| parent | fc3b338962cfe25e5e14907d9f46113731bc7f07 (diff) | |
asdsas
Diffstat (limited to 'others')
| -rwxr-xr-x | others/vm.sh2 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/others/vm.sh2 b/others/vm.sh2 index a12a922..1f100d8 100755 --- a/others/vm.sh2 +++ b/others/vm.sh2 @@ -142,8 +142,9 @@ case "$1" in genisoimage -output "$seed_iso" -volid cidata -joliet -rock user-data meta-data &> /dev/null || { echo "Failed to create seed.iso."; exit 1; } sudo cp $src_file $NEW_IMG_PATH &> /dev/null || { echo "Failed to create a new image."; exit 1; } - - if sudo virsh list --all | grep -q "$VM_NAME"; then + + if sudo virsh list --all | awk "\$2==\"$VM_NAME\"" | grep -q .; then + # if sudo virsh list --all | grep -q "$VM_NAME"; then echo -e "\n$VM_NAME already exist. Delete it using \n$0 manage -erase $VM_NAME\nExiting..." exit 1 fi |
