diff --git a/vmcreate1.sh b/vmcreate1.sh index ebe862a..61cae81 100644 --- a/vmcreate1.sh +++ b/vmcreate1.sh @@ -154,8 +154,8 @@ if [[ $# -eq 0 && -e "$file" ]]; then echo -n "" > hosts.tmp for line in $(cat "$file"); do echo "DEBUG line:$line" - ip=$(echo $line | cut -d ' ' -f 1) - hostname=$(echo $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 @@ -218,9 +218,9 @@ cat hosts.tmp; echo for line in $(cat hosts.tmp) do - ip=$(echo $line | cut -d ' ' -f 1) - vlan=$(echo $ip | cut -d '.' -f 3) - if [[ vlan -eq 0 ]]; then + ip=$(echo -n $line | cut -d ' ' -f 1) + vlan=$(echo -n $ip | cut -d '.' -f 3) + if [[ $vlan -eq 0 ]]; then mask=23 gw="10.10.0.1" vlan=100 @@ -228,7 +228,7 @@ do mask=24 gw="10.10.${vlan}.1" fi - hostname=$(echo $line | cut -d ' ' -f 2) + hostname=$(echo -n $line | cut -d ' ' -f 2) vmid=$(get_vmid "$ip") mksnippet #### DEBUG 2