首页 > 其他分享 >跳转主机脚本

跳转主机脚本

时间:2022-11-01 11:12:08浏览次数:99  
标签:脚本 主机 echo 10.252 USER && 跳转 commond txt

 1 #!/bin/bash
 2 echo '========================================================================================'
 3 echo '注:非以下4个IP外(输入000查看其他IP),需输入俩次,首次登陆IP时弹出yesORno,选择YES即可'
 4 #     cc.txt中可以加入常用登陆IP,无需全部都加,也可以将IP加到脚本里;
 5 #     bb.txt为登陆后的常用路径,记不住路径的可以加到里面;
 6 echo '========================================================================================'
 7 echo '失败归档:10.252.174.186'
 8 echo '归档流水重发:10.252.174.186'
 9 echo '重抛签约归档报文:10.252.175.202'
10 echo '模拟客户经理登陆:10.252.174.187'
11 #echo '======================================================================================='
12 HEADSCRIP=cd /rdata1/work_tools/headScripcd >/dev/null 2>&1
13 TRANSIDO=curl -H "Content-Type: application/json" -X GET http://10.252.179.108:8786/v1/handArchive/syncData?transIdo='流水' >/dev/null 2>&1
14 RECIVEPROV=curl -H "Content-Type: application/json" -X POST --data '{"prov":报文}' http://10.252.175.202:9311/prov/receive/ReciveProv >/dev/null 2>&1
15 STAFFMONI=cd ~/FTPCLI/bak/sso_abs && ./sso-url-abs.py yunwei 000 >/dev/null 2>&1
16 USER=appop
17 USERA=`whoami`
18 echo '========================================================================================'
19 echo `cat ./bb.txt|awk 'NR==1'`
20 echo `cat ./bb.txt|awk 'NR==2'`
21 echo `cat ./bb.txt|awk 'NR==3'`
22 echo `cat ./bb.txt|awk 'NR==4'`
23 echo '========================================================================================'
24 read -p "请输入要登陆的IP地址:" commond
25 
26 if [ -n $commond ]
27   then echo '输入密码:Paas_inf_Aqzzkw_123!'
28 fi
29 
30 if [ $commond = "10.252.174.186" ]
31   then
32     echo "1:失败归档/2:归档流水重发" &&
33       read -p "请输入 1or2:" nummer
34 
35   if [ $nummer = "1" ]
36      then ssh $USER@$commond && $HEADSCRIP
37 #         if [ $? -eq 0 ]
38 #            then  $HEADSCRIP
39 #         fi
40        else $TRANSIDO && ssh $USER@$commond
41   fi
42 elif
43        [ $commond = "10.252.175.202" ]
44         then ssh $USER@$commond && $RECIVEPROV
45 elif
46        [ $commond = "10.252.174.187" ]
47         then $STAFFMONI && ssh $USER@$commond
48 elif
49        [ $commond = "000" ]
50         then cat ./cc.txt
51 fi
52 
53 if [ $commond != "10.252.174.187" ] &&
54    [ $commond != "10.252.175.202" ] &&
55    [ $commond != "10.252.174.186" ]
56      then read -p "请输入要登陆的IP地址:" commond && ssh $USER@$commond
57 fi
58 
59 if [ $USERA = appop ]
60   then top
61 fi

 

标签:脚本,主机,echo,10.252,USER,&&,跳转,commond,txt
From: https://www.cnblogs.com/yeahzxw/p/16847025.html

相关文章