最新消息:阿啰哈,本人90后,目前单身,欢迎妹子们来撩!.(。→‿←。)

Telnet script

Shell 林志斌 999浏览

为了方便在项目上远程登陆到交换机、网关、服务器等设备上,遂写此脚本,简化击键、方便记忆。

Bash Shell: telnet script
#!/bin/bash
#Author: kashu
#Date: 2014-01-22
#Filename: .telnet.sh
#My website: http://www.kashu.org

echo -e "Swithes: 33[37;41mpasswd33[0m    PnPGW: admin 33[37;41mpasswd133[0m passwd2"
echo "1(GW) 48 49 51 52 58 59 101 103 104 106 107 108 109 110 112 113 115 116 252(Core)"
TEL(){
ping -s1 -W1 -c2 10.10.11."$1" &> /dev/null || exit
}
case $1 in
1) ssh [email protected] ;;
252|48|49|51|52|58|59|101|103|104|106|107|108|109|110|112|113|115|116) TEL "$1" && telnet 10.10.11.$1 ;;
*) exit ;;
esac

效果示例:

Bash Shell: telnet script
#!/bin/bash
#Author: kashu
#Date: 2014-01-22
#Filename: .telnet.sh
#My website: http://www.kashu.org

echo -e "PnPGW: admin 33[37;41mpasswd133[0m passwd2"
echo -e "Swithes: 33[37;41madmin33[0m 33[37;41madmin33[0m  CoreSW: 33[37;41madmin33[0m 33[37;41mAdmin33[0m"
echo '39 53 86 88 90 92 96 98 100 102 105 254(CoreSW)'
TEL(){
   ping -s1 -W1 -c2 192.168.201."$1" &> /dev/null || exit
}
case $1 in
   1) ssh [email protected] ;;
   39|53|86|88|90|92|96|98|100|102|105|254) TEL "$1" && telnet 192.168.201.$1 ;;
   *) exit ;;
esac

效果示例:

转载请注明:林志斌 » Telnet script

发表评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址