change of [[ to [
This commit is contained in:
parent
9b4cdbc40c
commit
be1ad867db
1 changed files with 3 additions and 3 deletions
|
@ -142,7 +142,7 @@ CREATE() {
|
||||||
RESTORE() {
|
RESTORE() {
|
||||||
echo "Are you sure you want to restore the rescue? (y/N)"
|
echo "Are you sure you want to restore the rescue? (y/N)"
|
||||||
read -r entry
|
read -r entry
|
||||||
if [[ "$entry" =~ ^[yY]$ ]]
|
if echo "$entry" | grep -q "^[yY]$"
|
||||||
then
|
then
|
||||||
cp -i "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow.backup" "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow"
|
cp -i "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow.backup" "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow"
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
@ -153,7 +153,7 @@ RESTORE() {
|
||||||
BACKUP() {
|
BACKUP() {
|
||||||
# Should test if the folder ${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow exist or else it will arrive an error.
|
# 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
|
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
|
then
|
||||||
cp -i "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow" "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow.backup"
|
cp -i "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow" "${MAIN_LOCATION}/${LOCATION}/${VMHOSTNAME}.cow.backup"
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
@ -162,7 +162,7 @@ BACKUP() {
|
||||||
|
|
||||||
SUPPRESS() {
|
SUPPRESS() {
|
||||||
read -p "Are you sure you want to delete all data relative to the vm $1? (y/N)" -r entry
|
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
|
then
|
||||||
rm -Ri "${MAIN_LOCATION}/${LOCATION}"
|
rm -Ri "${MAIN_LOCATION}/${LOCATION}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue