From 9b4cdbc40c9ec430730ff2081c16b66b1e219671 Mon Sep 17 00:00:00 2001 From: primardj Date: Tue, 23 Jan 2024 23:23:58 +0000 Subject: [PATCH] improvment of conf files, and changes of one [[ --- vm-start.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vm-start.sh b/vm-start.sh index f205bc8..761faf8 100755 --- a/vm-start.sh +++ b/vm-start.sh @@ -60,7 +60,7 @@ INIT() { read -p "How much memory will you need ? " -r MEMORY read -p "Do you want to forward ssh port (y/n) " -r entry - if [[ "$entry" =~ ^[yY]$ ]] + if echo "$entry" | grep -q "^[yY]$" then FORWARD=",hostfwd=tcp::10022-:22" # forward VM 22 port to Host 10022 fi @@ -68,12 +68,12 @@ INIT() { mkdir -p conf cat << EOF > "conf/$NAME-vm_var.sh" NAME="$NAME" -VMHOSTNAME="\$NAME-vm" +VMHOSTNAME="\${NAME}-vm" VMDRIVE="\${VMHOSTNAME}.cow" NPROC="$NPROC" MEMORY="$MEMORY" FORWARD="$FORWARD" -LOCATION="\$NAME-sandbox" +LOCATION="\${NAME}-sandbox" EOF chmod +x "conf/$NAME-vm_var.sh"