mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
add if directory exists function
This commit is contained in:
parent
69fe889f92
commit
1aa5943e67
1 changed files with 13 additions and 0 deletions
|
@ -88,6 +88,19 @@ if_file_exists() {
|
|||
fi
|
||||
}
|
||||
|
||||
if_directory_exists() {
|
||||
# Set the first argument passed to tihs function as a named variable for better readability
|
||||
local directory_to_test="${1}"
|
||||
# If the file is readable
|
||||
if [[ -d "${directory_to_test}" ]]; then
|
||||
# Return success
|
||||
return 0
|
||||
else
|
||||
# Otherwise, return a failure
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_distro_attributes() {
|
||||
# Put the current Internal Field Separator into another variable so it can be restored later
|
||||
OLD_IFS="$IFS"
|
||||
|
|
Loading…
Reference in a new issue