#目录地址
Root=/opt/app
File=/hosts
#将进程名写入 pid.txt
echo "去广告hosts已启动-此为显示错误" >> /opt/pid.txt
#更新AdHosts文件
cd $Root$File/
#下载更新最新规则
wget -O diyhost http://hosts.xuanlove.date/hosts.php
#启动命令
#重启dnsmasq
/etc/init.d/dnsmasq restart
#PHP判断插件运行状态
if [ -f /etc/hosts.d/diyhost ]
then
    if [ -s /etc/hosts.d/diyhost ]
    then
        echo "已更新"
    else
        echo "更新失败"
    fi
else
    echo "未安装"
fi