mirror of
https://github.com/octoleo/hosts.git
synced 2025-04-06 15:31:51 +00:00
_verify_write_permissions()
doesn't accept arguments.
This commit is contained in:
parent
affd8d8657
commit
40be65b7da
20
hosts
20
hosts
@ -681,7 +681,7 @@ add() {
|
|||||||
_debug printf "add() \${2}: %s\\n" "${2:-}"
|
_debug printf "add() \${2}: %s\\n" "${2:-}"
|
||||||
_debug printf "add() \${3}: %s\\n" "${3:-}"
|
_debug printf "add() \${3}: %s\\n" "${3:-}"
|
||||||
|
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
local _ip="${1:-}"
|
local _ip="${1:-}"
|
||||||
local _hostname="${2:-}"
|
local _hostname="${2:-}"
|
||||||
@ -794,7 +794,7 @@ backups() {
|
|||||||
|
|
||||||
case "${_subcommand}" in
|
case "${_subcommand}" in
|
||||||
create)
|
create)
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
local _timestamp
|
local _timestamp
|
||||||
_timestamp="$(date +"%Y%m%d%H%M%S")"
|
_timestamp="$(date +"%Y%m%d%H%M%S")"
|
||||||
@ -822,7 +822,7 @@ backups() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
if [[ "${HOSTS_PATH}" != "${_hosts_dirname}/${_filename:-}" ]] &&
|
if [[ "${HOSTS_PATH}" != "${_hosts_dirname}/${_filename:-}" ]] &&
|
||||||
[[ -e "${_hosts_dirname}/${_filename:-}" ]]
|
[[ -e "${_hosts_dirname}/${_filename:-}" ]]
|
||||||
@ -845,7 +845,7 @@ backups() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
if ! ((_skip_backup))
|
if ! ((_skip_backup))
|
||||||
then
|
then
|
||||||
@ -912,7 +912,7 @@ Exit status:
|
|||||||
1 Invalid parameters or entry exists.
|
1 Invalid parameters or entry exists.
|
||||||
HEREDOC
|
HEREDOC
|
||||||
block() {
|
block() {
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
if [[ -z "${1:-}" ]]
|
if [[ -z "${1:-}" ]]
|
||||||
then
|
then
|
||||||
@ -944,7 +944,7 @@ Exit status:
|
|||||||
1 Invalid parameters or entry not found.
|
1 Invalid parameters or entry not found.
|
||||||
HEREDOC
|
HEREDOC
|
||||||
disable() {
|
disable() {
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
local _search_string="${1:-}"
|
local _search_string="${1:-}"
|
||||||
|
|
||||||
@ -1017,7 +1017,7 @@ Description:
|
|||||||
Open the ${HOSTS_PATH} file in your \$EDITOR.
|
Open the ${HOSTS_PATH} file in your \$EDITOR.
|
||||||
HEREDOC
|
HEREDOC
|
||||||
edit() {
|
edit() {
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
if [[ -z "${EDITOR}" ]]
|
if [[ -z "${EDITOR}" ]]
|
||||||
then
|
then
|
||||||
@ -1042,7 +1042,7 @@ Exit status:
|
|||||||
1 Invalid parameters or entry not found.
|
1 Invalid parameters or entry not found.
|
||||||
HEREDOC
|
HEREDOC
|
||||||
enable() {
|
enable() {
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
local _search_string="${1:-}"
|
local _search_string="${1:-}"
|
||||||
|
|
||||||
@ -1184,7 +1184,7 @@ Exit status:
|
|||||||
1 Invalid parameters or entry not found.
|
1 Invalid parameters or entry not found.
|
||||||
HEREDOC
|
HEREDOC
|
||||||
remove() {
|
remove() {
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
local _is_search_pair=0
|
local _is_search_pair=0
|
||||||
local _force_skip_prompt=0
|
local _force_skip_prompt=0
|
||||||
@ -1397,7 +1397,7 @@ Exit status:
|
|||||||
1 Invalid parameters or entry not found.
|
1 Invalid parameters or entry not found.
|
||||||
HEREDOC
|
HEREDOC
|
||||||
unblock() {
|
unblock() {
|
||||||
_verify_write_permissions "$@"
|
_verify_write_permissions
|
||||||
|
|
||||||
if [[ -z "${1:-}" ]]
|
if [[ -z "${1:-}" ]]
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user