Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239263
  • 博文数量: 49
  • 博客积分: 246
  • 博客等级: 二等列兵
  • 技术积分: 1034
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-02 13:18
文章分类

全部博文(49)

分类: 系统运维

2015-06-19 11:43:12


点击(此处)折叠或打开

  1. #!/bin/bash

  2. #SSH Auth 2015-06-19

  3. trap "" HUP INT QUIT TSTP
  4. clear
  5. sleep 0.5
  6. echo -e "...................$(date) Login Server..............\n"
  7. export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

  8. num="1"
  9. max="3"

  10. Lock() {
  11.     for i in {1..5};do
  12.         echo -e "..................${i}......................\n"
  13.         sleep 2;
  14.     done
  15. }

  16. NUM_MAX() {
  17.     if [[ $num > 3 ]];then
  18.         Lock
  19.     fi
  20. }

  21. while true;do
  22.         NUM_MAX
  23.         read -p "please input user:" user
  24.         if [[ $user == "root" ]];then
  25.             echo "user auth success!"
  26.         else
  27.             echo "user auth fail."
  28.              num=`expr $num + 1`
  29.             continue
  30.         fi

  31.         read -p "please input pass:" pass

  32.             if [[ $pass == "12345" ]];then
  33.              echo "pass auth success!"
  34.              break
  35.             else
  36.              echo "pass auth fail."
  37.              continue
  38.             fi
  39. done
  40. trap : HUP INT QUIT TSTP

阅读(2439) | 评论(0) | 转发(0) |
1

上一篇:HAproxy配置

下一篇:JAVA + FastDFS 架构图设计

给主人留下些什么吧!~~