@@ -1994,7 +1994,7 @@ if [ "\$ACTION" = "ifup" ] && [ "\$INTERFACE" = "lan" ]; then
19941994fi
19951995EOF
19961996 chmod +x ${hotdnsqFile}
1997- if [ -z "$(grep {{.dns_server}} ${hotdnsqFile} )" ]; then
1997+ if [ -z "$(grep {{.dns_server}} /etc/resolv.dnsmasq.conf )" ]; then
19981998 ${hotdnsqFile}
19991999 fi
20002000}
@@ -2424,11 +2424,12 @@ uci commit dhcp
24242424set -e
24252425{{.addString}}
24262426uci commit dhcp
2427- # report
2427+ set +e
2428+
2429+ [ "{{.mode}}" == "change" ] && /etc/init.d/dnsmasq reload
24282430if [ -f "/usr/sbin/hi-static-leases" ]; then
24292431 /usr/sbin/hi-static-leases
24302432fi
2431- set +e
24322433if [ "{{.mode}}" == "overwrite" ]; then
24332434 echo > /etc/clients
24342435 echo > /tmp/dhcp.leases
@@ -2499,6 +2500,7 @@ dump_item() {
24992500 local mac=$(echo $1|tr a-z A-Z)
25002501 res=$(awk '$1=="'$mac'" {sub(/[0-1]/,"'$status'",$7);print}' /etc/clients)
25012502 sed -i "/$mac/c $res" /etc/clients
2503+ curl 'http://localhost/device' -d "mac=$mac&blocked=$status" &>/dev/null
25022504 if [ "$status" == "0" ]; then
25032505 ipset del block_device $mac
25042506 sed -i "/$mac/d" /mnt/blocked
@@ -2511,6 +2513,7 @@ touch /var/run/block.lock
25112513json_for_each_item "dump_item" "macs"
25122514rm -f /var/run/block.lock
25132515set +e
2516+ curl -k 'http://localhost/device?write' &>/dev/null
25142517hi-clients
25152518` )
25162519
@@ -2734,7 +2737,7 @@ echo "#------------ping start--------------">/var/log/ping.log
27342737oping -c5 \$import_ip \$node_host 8.8.8.8 >>/var/log/ping.log
27352738if [ -n "\$(cat /var/log/ping.log|grep 'timeout')" ]; then
27362739 echo "#------------ping end--------------">>/var/log/ping.log
2737- cat /var/log/ping.log>> /var/log/exec.log
2740+ cat /var/log/ping.log >> /var/log/exec.log
27382741fi
27392742EOF
27402743if [ -n "$(crontab -l|grep net_ping_detected)" ]; then
0 commit comments