Add `_verify_write_permissions()` checks to `block` and `unblock`.

This commit is contained in:
William Melody 2017-03-01 19:32:49 -08:00
parent 3237818607
commit 404ee19742
1 changed files with 2 additions and 0 deletions

2
hosts
View File

@ -756,6 +756,7 @@ Description:
for IPv4 and both \`fe80::1%lo0\` and \`::1\` for IPv6.
HEREDOC
block() {
_verify_write_permissions "$@"
if [[ -z "${1}" ]]
then
${_ME} help block
@ -1173,6 +1174,7 @@ Description:
Unblock a given hostname by removing its entries from the hosts file.
HEREDOC
unblock() {
_verify_write_permissions "$@"
if [[ -z "${1}" ]]
then
${_ME} help unblock