有几台服务器太久没上,而这几台服务器我刚好又配置了 jumpserver,今天用 jumpserver 登录发现有两个文件以前从来没见过,guapan new.sh。其中 guapan 这个文件一打开就崩溃,我下载到本地 win 试着用记事本打开,一打开电脑就超级卡,new.sh cat 后: #!/bin/bash
namelist=$(cat /proc/net/dev | grep -v Inter | grep -v face | awk -F: '{print $1}') MAC=$(ip a | perl -lane 'print /.link/ether\s(\S)\s/' | tail -n 1)
for i in ${namelist}; do if [ -e /etc/sysconfig/network-scripts/ifcfg-${i} ]; then echo "This network config file is exists." else echo "DEVICE=${i}" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "TYPE=Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "NM_CONTROLLED=yes" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "BOOTPROTO=static" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "NAME="System ${i}"" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "IPADDR=$1" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "NETMASK=$2" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "GATEWAY=$3" >> /etc/sysconfig/network-scripts/ifcfg-${i} echo "HWADDR=${MAC}" >> /etc/sysconfig/network-scripts/ifcfg-${i} && service network restart fi done
后来我发现 jumpserver 登上去的几台服务器都有这两个文件,该不是被挂上了码吧?
1
Havee 2017-05-26 22:08:55 +08:00
不是
网卡变动,一键脚本重新配置网络 |
3
menc 2017-05-27 18:18:36 +08:00
“我下载到本地 win 试着用记事本打开,一打开电脑就超级卡”
感觉莫名惊悚,然而是 LZ 自己吓唬自己。 |
4
tempdban 2017-05-27 19:04:36 +08:00 via Android
guapan 是个镜像吧
mount 一下看看? |