;log文件路径 logFilePath="C:Users18430Desktopjavalogfiles" ;登陆user USERNAME = 'root' ;登陆密码 PASSWORD = '123456' ;连接登陆命令 COMMAND = '192.168.188.128' strconcat COMMAND ':22 /ssh /2 /auth=password /user=' strconcat COMMAND USERNAME strconcat COMMAND ' /passwd=' strconcat COMMAND PASSWORD ;连接
connect COMMAND wait '' ; ; PowerCycle with logging ; gettime timestr "%Y%m%d-%H%M%S" sprintf2 filename '%sconsole_%s_%s.log' logFilePath USERNAME timestr logopen filename 0 0 step = 0 ;while 1 ; call show_step strconcat msg COMMAND strconcat msg ' login successfully '#13#10 logwrite msg sendln 'cd /home' sendln 'touch jjj.txt' wait ' ' ;pause 2 ;endwhile logclose end :show_step step = step + 1 gettime timestr sprintf2 str '[%d] %s' step timestr statusbox str 'counter' return