#因crt会话配置文件中密码加密,批量创建的会话用户\密码要一致;
1、首先手动创建第一台主机的会话登录成功并保存;转到crt软件目录下 \Data\Settings\Config\Sessions;复制刚才创建会话的配置文件并重命名为tem.ini
2、创建server.info文件:
格式为“会话名称,IP地址”
test-01,10.10.10.1
test-02,10.10.10.2
3、主配置文件
//cat crt.sh
#!/bin/bash
pack=1 #pack=1会话打包;
ini=tem.ini
info=server.info
path=./home/
function mylog() {
local dat_e=$(date +[%F--%T])
echo -e "$dat_e $1"
}
function judge() {
if [ ! -f $ini ] ;then
mylog "no have tem.ini file";exit 1
fi
if [ ! -f $info ] ;then
mylog "no have server info file";exit 2
fi
if [ ! -d $path ] ;then
mkdir $path
fi
}
judge
function change() {
mylog "start read ${info}"
while read line
do
arr=(${line//,/ })
name=