From be1ad867db60e3a6cc92b2f681aa0648114ec021 Mon Sep 17 00:00:00 2001 From: primardj Date: Tue, 23 Jan 2024 23:26:37 +0000 Subject: [PATCH] change of [[ to [ --- vm-start.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vm-start.sh b/vm-start.sh index 761faf8..9d1b346 100755 --- a/vm-start.sh +++ b/vm-start.sh @@ -142,7 +142,7 @@ CREATE() { RESTORE() { echo "Are you sure you want to restore the rescue? (y/N)" read -r entry - if [[ "$entry" =~ ^[yY]$ ]] + if echo "$entry" | grep -q "^[yY]$" then cp -i "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow.backup" "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow" echo "Done" @@ -153,7 +153,7 @@ RESTORE() { BACKUP() { # Should test if the folder ${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow exist or else it will arrive an error. read -p "Are you sure you want to backup the volume? If you continue the previous backup will be lost (y/N) " -r entry - if [[ "$entry" =~ ^[yY]$ ]] + if echo "$entry" | grep -q "^[yY]$" then cp -i "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow" "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow.backup" echo "Done" @@ -162,7 +162,7 @@ BACKUP() { SUPPRESS() { read -p "Are you sure you want to delete all data relative to the vm $1? (y/N)" -r entry - if [[ "$entry" =~ ^[yY]$ ]] + if echo "$entry" | grep -q "^[yY]$" then rm -Ri "${MAIN_LOCATION}/${LOCATION}" fi