2010年4月28日

網路檢測script

#!/bin/sh
#網路檢測程式 v_0.1
#create by Vega 2005.10.17
#

ip01='1.1.1.1'

net=`ping -c 1 "$ip01"|grep '100% packet loss'`
if [ "$net" != "" ]; then
echo ""$ip01" 無法連線."
echo ""$ip01" 無法連線." > netstate
mail ap -s ""$ip01" 連線異常" < netstate
else
echo "" > netstate
fi

硬碟大小監控script

#!/bin/sh
#
# 網路監控
# 本機硬碟大小監控
# 建立日期 2006.04.21 by Vega

day=`date +%Y%m%d-%R`
cd /root/monitor
df -BMB > df
mail vega,ap -s 硬碟空間-"$day" < df

FTP Script

#!/bin/sh

ftp -inv xx.xx.xx.xx << EOF

-i turns off interactive prompting.
-n Restrains FTP from attempting the auto-login feature.
-v enables verbose and progress.


user temp temp
prompt
verbose
bin
cd l7
mget iptables*
quit
EOF