Update create_vm.sh

This commit is contained in:
spiritLHLS 2023-04-12 09:58:35 +08:00 committed by GitHub
parent 68d095731f
commit 6b9a63d780
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
#!/bin/bash
# from
# https://github.com/spiritLHLS/pve
# 2023.04.11
# 2023.04.12
# cd /root
@ -34,13 +34,14 @@ pre_check(){
# done
# fi
log_file="vmlog"
if [ ! -f "vmlog" ]; then
check_info(){
log_file="vmlog"
if [ ! -f "vmlog" ]; then
yellow "当前目录下不存在vmlog文件"
vm_num=202
web2_port=40003
port_end=50025
else
else
while read line; do
last_line="$line"
done < "$log_file"
@ -54,16 +55,17 @@ else
port_start="${last_line_array[9]}"
port_end="${last_line_array[10]}"
system="${last_line_array[11]}"
green "最后一个NAT服务器对应的信息"
green "当前最后一个NAT服务器对应的信息"
echo "NAT服务器: $vm_num"
# echo "用户名: $user"
# echo "密码: $password"
# echo "用户名: $user"
# echo "密码: $password"
echo "外网SSH端口: $ssh_port"
echo "外网80端口: $web1_port"
echo "外网443端口: $web2_port"
echo "外网其他端口范围: $port_start-$port_end"
echo "系统:$system"
fi
fi
}
build_new_vms(){
while true; do
@ -92,4 +94,6 @@ build_new_vms(){
}
pre_check
check_info
build_new_vms
check_info