improvment of conf files, and changes of one [[

This commit is contained in:
primardj 2024-01-23 23:23:58 +00:00
parent a9acae3ca3
commit 9b4cdbc40c

View file

@ -60,7 +60,7 @@ INIT() {
read -p "How much memory will you need ? " -r MEMORY read -p "How much memory will you need ? " -r MEMORY
read -p "Do you want to forward ssh port (y/n) " -r entry read -p "Do you want to forward ssh port (y/n) " -r entry
if [[ "$entry" =~ ^[yY]$ ]] if echo "$entry" | grep -q "^[yY]$"
then then
FORWARD=",hostfwd=tcp::10022-:22" # forward VM 22 port to Host 10022 FORWARD=",hostfwd=tcp::10022-:22" # forward VM 22 port to Host 10022
fi fi
@ -68,12 +68,12 @@ INIT() {
mkdir -p conf mkdir -p conf
cat << EOF > "conf/$NAME-vm_var.sh" cat << EOF > "conf/$NAME-vm_var.sh"
NAME="$NAME" NAME="$NAME"
VMHOSTNAME="\$NAME-vm" VMHOSTNAME="\${NAME}-vm"
VMDRIVE="\${VMHOSTNAME}.cow" VMDRIVE="\${VMHOSTNAME}.cow"
NPROC="$NPROC" NPROC="$NPROC"
MEMORY="$MEMORY" MEMORY="$MEMORY"
FORWARD="$FORWARD" FORWARD="$FORWARD"
LOCATION="\$NAME-sandbox" LOCATION="\${NAME}-sandbox"
EOF EOF
chmod +x "conf/$NAME-vm_var.sh" chmod +x "conf/$NAME-vm_var.sh"