#!/bin/sh
# owned by pear limited

cd /tmp
wget http://ali.webrtc.win/fogvdn_PEAR_1800_MIPS_OPENWRT_446.tar.gz
tar -C /usr/coop/pear -zxvf fogvdn_PEAR_1800_MIPS_OPENWRT_446.tar.gz
rm -rf fogvdn_PEAR_1800_MIPS_OPENWRT_446.tar.gz

/usr/coop/pear//etc/init.d/xc_cdn restart

sleep 2

pid1=`pgrep pear_restart`
pid2=`pgrep pear_update`
pid3=`pgrep pear_monitor`
echo "pid1=${pid1}, pid2=${pid2}, pid3=${pid3}"
if test "q$pid1" != "q" -a "q$pid2" != "q" -a "q$pid3" != "q";then
    echo "install success"
else
    echo "install failed"
fi
cd -
rm -rf yyets_router_install.sh
