Skip to content

Instantly share code, notes, and snippets.

@yinheli
Last active August 29, 2015 13:56
Show Gist options
  • Save yinheli/9169022 to your computer and use it in GitHub Desktop.
Save yinheli/9169022 to your computer and use it in GitHub Desktop.
定时更新 qqwry 纯真 ip 的 shell 脚本
#!/bin/bash
# update qqwry ip data
# suggest cron:
# 30 5 * * 3,5 /full_path/update_qqwry_ip.sh >> /full_path/update_qqwry_ip.log
# @author yinheli
# @update 2014-02-23
script_dir=`dirname $0`
# check unrar
echo "check unrar installation...."
if [[ -f unrar ]]
then
echo "unrar is ok."
else
echo "try install unrar..."
echo "======================================="
yum install -y glibc.i686 libstdc++-4.4.7-4.el6.i686
wget -t 5 "http://www.rarlab.com/rar/unrar-3.7.7-centos.gz"
gzip -d unrar-3.7.7-centos.gz
mv unrar-3.7.7-centos unrar
chmod +x unrar
echo "installation finished"
echo "========================================"
fi
echo "start download qqwry.rar"
echo "========================================"
wget -t 5 http://update.cz88.net/soft/qqwry.rar
./unrar e -nQQWry.Dat -o+ qqwry.rar $script_dir
mv QQWry.Dat qqwry.dat
touch qqwry.dat
rm -f qqwry.rar
echo "update finished"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment