|
|
|
|
405
|
blocked_domain="$1"
|
405
|
blocked_domain="$1"
|
406
|
if ! grep "$blocked_domain" $FIREWALL_DOMAINS; then
|
406
|
if ! grep "$blocked_domain" $FIREWALL_DOMAINS; then
|
407
|
hexstr=$(domain_to_hex_string $blocked_domain)
|
407
|
hexstr=$(domain_to_hex_string $blocked_domain)
|
408
|
- iptables -I FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
|
|
409
|
- iptables -I FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
|
|
|
|
408
|
+ iptables -A INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
|
|
409
|
+ iptables -A INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
410
|
echo "${blocked_domain}" >> $FIREWALL_DOMAINS
|
410
|
echo "${blocked_domain}" >> $FIREWALL_DOMAINS
|
411
|
save_firewall_settings
|
411
|
save_firewall_settings
|
412
|
fi
|
412
|
fi
|
|
|
|
|
416
|
unblocked_domain="$1"
|
416
|
unblocked_domain="$1"
|
417
|
if grep "${unblocked_domain}" $FIREWALL_DOMAINS; then
|
417
|
if grep "${unblocked_domain}" $FIREWALL_DOMAINS; then
|
418
|
hexstr=$(domain_to_hex_string $unblocked_domain)
|
418
|
hexstr=$(domain_to_hex_string $unblocked_domain)
|
419
|
- iptables -D FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
|
|
420
|
- iptables -D FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
|
|
|
|
419
|
+ iptables -D INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
|
|
420
|
+ iptables -D INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
|
421
|
sed -i "/${unblocked_domain}/d" $FIREWALL_DOMAINS
|
421
|
sed -i "/${unblocked_domain}/d" $FIREWALL_DOMAINS
|
422
|
save_firewall_settings
|
422
|
save_firewall_settings
|
423
|
fi
|
423
|
fi
|