mirror of
https://github.com/octoleo/hosts.git
synced 2024-05-31 05:30:47 +00:00
Rename search_term
to search_string
in enable
and disable
.
`search_string` is slightly more descriptive, and it's the name that's used in `remove`.
This commit is contained in:
parent
1242d0b4bc
commit
db4df46caa
28
hosts
28
hosts
|
@ -723,17 +723,17 @@ Description:
|
||||||
EOM
|
EOM
|
||||||
disable() {
|
disable() {
|
||||||
_verify_write_permissions
|
_verify_write_permissions
|
||||||
local search_term=$1
|
local search_string=$1
|
||||||
if [[ -z "${search_term}" ]]
|
if [[ -z "${search_string}" ]]
|
||||||
then
|
then
|
||||||
$_ME help disable
|
$_ME help disable
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
_debug printf "disable() \$search_term: %s\n" "$search_term"
|
_debug printf "disable() \$search_string: %s\n" "$search_string"
|
||||||
|
|
||||||
target_regex_ip="^\(${search_term}[${_TAB_SPACE_}]..*\)$"
|
target_regex_ip="^\(${search_string}[${_TAB_SPACE_}]..*\)$"
|
||||||
target_regex_commented_hostname="^\([^#]..*[${_TAB_SPACE_}]${search_term}[${_TAB_SPACE_}]..*\)$"
|
target_regex_commented_hostname="^\([^#]..*[${_TAB_SPACE_}]${search_string}[${_TAB_SPACE_}]..*\)$"
|
||||||
target_regex_hostname="^\([^#]..*[${_TAB_SPACE_}]${search_term}\)$"
|
target_regex_hostname="^\([^#]..*[${_TAB_SPACE_}]${search_string}\)$"
|
||||||
|
|
||||||
# Regular Expression Notes
|
# Regular Expression Notes
|
||||||
#
|
#
|
||||||
|
@ -750,7 +750,7 @@ disable() {
|
||||||
_debug printf "disable() \$targets: %s\n" "$targets"
|
_debug printf "disable() \$targets: %s\n" "$targets"
|
||||||
if [[ -z "${targets}" ]]
|
if [[ -z "${targets}" ]]
|
||||||
then
|
then
|
||||||
_die printf "Not found: %s\n" "${search_term}"
|
_die printf "Not found: %s\n" "${search_string}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Disabling:\n%s\n" "${targets}"
|
printf "Disabling:\n%s\n" "${targets}"
|
||||||
|
@ -809,17 +809,17 @@ Description:
|
||||||
EOM
|
EOM
|
||||||
enable() {
|
enable() {
|
||||||
_verify_write_permissions
|
_verify_write_permissions
|
||||||
local search_term=$1
|
local search_string=$1
|
||||||
if [[ -z "${search_term}" ]]
|
if [[ -z "${search_string}" ]]
|
||||||
then
|
then
|
||||||
$_ME help enable
|
$_ME help enable
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
_debug printf "enable() \$search_term: %s\n" "$search_term"
|
_debug printf "enable() \$search_string: %s\n" "$search_string"
|
||||||
|
|
||||||
target_regex_ip="^\#disabled: \(${search_term}[${_TAB_SPACE_}]..*\)$"
|
target_regex_ip="^\#disabled: \(${search_string}[${_TAB_SPACE_}]..*\)$"
|
||||||
target_regex_commented_hostname="^\#disabled: \(..*[${_TAB_SPACE_}]${search_term}[${_TAB_SPACE_}]..*\)$"
|
target_regex_commented_hostname="^\#disabled: \(..*[${_TAB_SPACE_}]${search_string}[${_TAB_SPACE_}]..*\)$"
|
||||||
target_regex_hostname="^\#disabled: \(..*[${_TAB_SPACE_}]${search_term}\)$"
|
target_regex_hostname="^\#disabled: \(..*[${_TAB_SPACE_}]${search_string}\)$"
|
||||||
|
|
||||||
# Regular Expression Notes
|
# Regular Expression Notes
|
||||||
#
|
#
|
||||||
|
@ -836,7 +836,7 @@ enable() {
|
||||||
_debug printf "enable() \$targets: %s\n" "$targets"
|
_debug printf "enable() \$targets: %s\n" "$targets"
|
||||||
if [[ -z "${targets}" ]]
|
if [[ -z "${targets}" ]]
|
||||||
then
|
then
|
||||||
_die printf "Not found: %s\n" "${search_term}"
|
_die printf "Not found: %s\n" "${search_string}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Enabling:\n%s\n" "${targets}"
|
printf "Enabling:\n%s\n" "${targets}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user