From 6a874d576a26249db1a526876c2b0487d0e0c977 Mon Sep 17 00:00:00 2001 From: hc Date: Tue, 22 Oct 2024 14:28:35 +0800 Subject: asdsas --- others/vm.sh2 | 5 +++-- setup.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 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 diff --git a/setup.sh b/setup.sh index 83efcd8..05a3118 100755 --- a/setup.sh +++ b/setup.sh @@ -54,10 +54,10 @@ set statusline=%F " shows full file path EOF -tee -a ~/.bashrc > /dev/null << 'EOF' +tee -a ~/.bashrc > /dev/null << 'EOF2' LS_COLORS=$LS_COLORS:'di=38;5;135:' ; export LS_COLORS PS1='[\[\033[01;32m\]\u\[\033[00m\]@\h \[\033[38;5;135m\]\W\[\033[00m\]]\$ ' -EOF +EOF2 source ~/.bashrc sudo timedatectl set-timezone Asia/Singapore -- cgit v1.2.3-70-g09d2