#!/bin/bash
if [ ! -d /soft ];then
mkdir /soft
fi
which rkhunter
if [ $? -eq 0 ];then
echo "rkhunter is already install!!!"
else
wget http://nchc.dl.sourceforge.net/project/rkhunter/rkhunter/1.4.2/rkhunter-1.4.2.tar.gz
mv rkhunter-1.4.2.tar.gz /soft/
cd /soft
tar xf rkhunter-1.4.2.tar.gz
cd rkhunter-1.4.2
./installer.sh --layout default --install
cat >> /var/spool/cron/root << EOF
#更新rkhunter程序数据库
1 2 * * 6 /usr/local/bin/rkhunter --update >/dev/nul 2>&1
#执行检查木马、后面程序
1 2 * * 7 /usr/local/bin/rkhunter -c --sk >/dev/nul 2>&1
EOF
fi
crontab -l