mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-02-01 10:38:22 +08:00
Update create_vm.sh
This commit is contained in:
parent
aa993438c6
commit
63128bc6b3
1 changed files with 3 additions and 3 deletions
|
@ -36,13 +36,13 @@ fi
|
||||||
|
|
||||||
if [ ! -f "vmlog" ]; then
|
if [ ! -f "vmlog" ]; then
|
||||||
yellow "当前目录下不存在vmlog文件"
|
yellow "当前目录下不存在vmlog文件"
|
||||||
nat_num=202
|
vm_num=202
|
||||||
web2_port=40003
|
web2_port=40003
|
||||||
port_end=50025
|
port_end=50025
|
||||||
else
|
else
|
||||||
lines=$(cat vmlog | sed '/^$/d')
|
lines=$(cat vmlog | sed '/^$/d')
|
||||||
last_line=$(echo "$lines" | tail -n 1)
|
last_line=$(echo "$lines" | tail -n 1)
|
||||||
nat_num=$(echo "$last_line" | awk '{print $1}')
|
vm_num=$(echo "$last_line" | awk '{print $1}')
|
||||||
user=$(echo "$last_line" | awk '{print $2}')
|
user=$(echo "$last_line" | awk '{print $2}')
|
||||||
password=$(echo "$last_line" | awk '{print $3}')
|
password=$(echo "$last_line" | awk '{print $3}')
|
||||||
ssh_port=$(echo "$last_line" | awk '{print $4}')
|
ssh_port=$(echo "$last_line" | awk '{print $4}')
|
||||||
|
@ -70,7 +70,7 @@ build_new_vms(){
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
for ((i=1; i<=$new_nums; i++)); do
|
for ((i=1; i<=$new_nums; i++)); do
|
||||||
vm_num=$(($nat_num + 1))
|
vm_num=$(($vm_num + 1))
|
||||||
ori=$(date | md5sum)
|
ori=$(date | md5sum)
|
||||||
user=${ori: 2: 4}
|
user=${ori: 2: 4}
|
||||||
ori=$(date | md5sum)
|
ori=$(date | md5sum)
|
||||||
|
|
Loading…
Reference in a new issue