#!/bin/bash ############################################################ # $Name: Springboard.sh # $Version: v1.0 # $Functions: # $Author: Jeson Li # $organization: www.lzbbg.cn # $Create Date: 2017-03-10 # $Mail: libobin@tom.com # $Description: This scripts funcsion is tiao ban ji ############################################################ # Control login users using springboard # echo '[ $UID -ne 0 ] && [ $USER != "jeson" ] && source /server/tools_scripts/Springboard.sh' /etc/profile.d/tb.sh remote_user=$USER remote_password=123456 remote_Port=52113 path_FenFa_sshKey_exp=/server/tools_scripts/send_sshkey.exp while true do trap '' INT EXIT TSTP TERM HUP clear cat <<-menu ============= Host List ============= $(awk 'NR>2&&NF>2{print " "NR-2"\t",$1"\t"$2}' /etc/hosts) ------------------------------------- 0 EXIT "Only for root and jeson user !" ------------------------------------- menu read -p "Please select number:" num if [ $num -eq 0 ];then exit 1 elif [ $num -gt 0 ];then ssh -p52113 $USER@$(awk -F"[ \t]+" "NR==$(($num+2)) && NF>2"'{print $2}' /etc/hosts) elif [ "$num" == "sshkey" ];then sudo yum -y install expect [ ! -f ~/.ssh/id_dsa ] && { ssh-keygen -t dsa -q -P '' -f ~/.ssh/id_dsa>/dev/null ; } for remote_ip in $(awk -F"[ \t]+" "NR>2 && NF>2"'{print $2}' /etc/hosts) do expect $path_FenFa_sshKey_exp $remote_Port $remote_user $remote_password $remote_ip ~/.ssh/id_dsa.pub done fi done
今天的文章springboard是什么意思_Spring Framework分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:http://bianchenghao.cn/44767.html