#!/usr/bin/bash trap "echo 禁止操作" INT source ./tools.sh while : do clear echo "[客户端地址] `echo $SSH_CLIENT|awk '{print $1}'`" echo "[当前时间 ] `date +'%Y-%m-%d %H:%M:%S'`" echo "===============================================" printf "%-5s %-20s %-50s\n" "seq" "tool" "desc" printf "%-5s %-20s %-50s\n" "01" "login host" "这是用户信息数据库" printf "%-5s %-20s %-50s\n" "02" "add host" "管理员添加服务器" printf "%-5s %-20s %-50s\n" "q" "quit" "退出跳板机" read -p "请输入需要执行的序号:" n case $n in 01|1) login_host sleep 10 ;; 02|2) add_host ;; q|Q) echo "退出登陆" exit 0 esac done