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 "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"