From e209da172eca4c173d0d69afebffe68c7c66aedf Mon Sep 17 00:00:00 2001 From: Dmitry Badovsky Date: Sun, 26 Oct 2025 15:53:06 +0000 Subject: [PATCH] Update vmcreate1.sh --- vmcreate1.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vmcreate1.sh b/vmcreate1.sh index e7cf239..31002ed 100644 --- a/vmcreate1.sh +++ b/vmcreate1.sh @@ -156,8 +156,8 @@ if [[ $# -eq 0 && -e "$file" ]]; then cat "$file" for line in $(cat "$file"); do echo "DEBUG line:$line" - ip=$(echo -n $line | cut -d ' ' -f 1) - hostname=$(echo -n $line | cut -d ' ' -f 2) + ip=$(echo -n $line | cut -d ';' -f 1) + hostname=$(echo -n $line | cut -d ';' -f 2) if [[ $? -eq 0 ]]; then hostcheck "$hostname" if [[ $? -eq 0 ]]; then @@ -182,7 +182,7 @@ if [[ $# -ne 0 ]]; then for arg in "$@"; do ipcheck "$arg" if [ $? -eq 0 ]; then - echo -n "$arg " >> ./hosts.tmp + echo -n "$arg;" >> ./hosts.tmp echo -n "vm" >> ./hosts.tmp get_vmid "$arg" >> hosts.tmp echo >> hosts.tmp @@ -220,7 +220,7 @@ cat hosts.tmp; echo for line in $(cat hosts.tmp) do - ip=$(echo -n $line | cut -d ' ' -f 1) + ip=$(echo -n $line | cut -d ';' -f 1) vlan=$(echo -n $ip | cut -d '.' -f 3) if [[ $vlan -eq 0 ]]; then mask=23 @@ -230,7 +230,7 @@ do mask=24 gw="10.10.${vlan}.1" fi - hostname=$(echo -n $line | cut -d ' ' -f 2) + hostname=$(echo -n $line | cut -d ';' -f 2) vmid=$(get_vmid "$ip") mksnippet #### DEBUG 2