Update vmcreate1.sh

This commit is contained in:
2025-10-26 15:41:05 +00:00
parent ab544b776a
commit 353023a5cc

View File

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