Check that domains contain dots

This commit is contained in:
Bob Mottram 2017-01-13 20:12:29 +00:00
parent 27f819f4ef
commit 88a987446f
1 changed files with 10 additions and 6 deletions

View File

@ -1846,9 +1846,11 @@ function domain_blocking_add {
0)
blocked_domain=$(<$data)
if [ ${#blocked_domain} -gt 2 ]; then
firewall_block_domain $blocked_domain
dialog --title $"Block a domain" \
--msgbox $"The domain $blocked_domain has been blocked" 6 40
if [[ "${blocked_domain}" == '.' ]]; then
firewall_block_domain $blocked_domain
dialog --title $"Block a domain" \
--msgbox $"The domain $blocked_domain has been blocked" 6 40
fi
fi
;;
esac
@ -1865,9 +1867,11 @@ function domain_blocking_remove {
0)
unblocked_domain=$(<$data)
if [ ${#unblocked_domain} -gt 2 ]; then
firewall_unblock_domain $unblocked_domain
dialog --title $"Unblock a domain" \
--msgbox $"The domain $unblocked_domain has been unblocked" 6 40
if [[ "${unblocked_domain}" == '.' ]]; then
firewall_unblock_domain $unblocked_domain
dialog --title $"Unblock a domain" \
--msgbox $"The domain $unblocked_domain has been unblocked" 6 40
fi
fi
;;
esac