mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Code style: Use explicit form of CLI arguments
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net> Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
This commit is contained in:
parent
b595b3b5f4
commit
91e0d668e0
@ -598,7 +598,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
# running the script.
|
||||
if [[ $url == "file://"* ]]; then
|
||||
# Get the file path
|
||||
file_path=$(echo "$url" | cut -d'/' -f3-)
|
||||
file_path=$(echo "$url" | cut --delimiter='/' --fields=3-)
|
||||
# Check if the file exists and is a regular file (or a symlink to one)
|
||||
if [[ ! -e $file_path ]]; then
|
||||
# Output that the file does not exist
|
||||
@ -610,7 +610,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
download=false
|
||||
else
|
||||
# Check if the file has a+r permissions
|
||||
permissions=$(stat -Lc "%a" "$file_path")
|
||||
permissions=$(stat --dereference --format="%a" "$file_path")
|
||||
if [[ $permissions == *4 || $permissions == *5 || $permissions == *6 || $permissions == *7 ]]; then
|
||||
# Output that we are using the local file
|
||||
echo -e "${OVER} ${INFO} Using local file ${file_path}"
|
||||
@ -624,7 +624,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
|
||||
if [[ "${download}" == true ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2>/dev/null)
|
||||
httpCode=$(curl --connect-timeout ${curl_connect_timeout} --silent --location ${compression} ${cmd_ext} ${heisenbergCompensator} --write-out "%{http_code}" "${url}" --output "${listCurlBuffer}" 2>/dev/null)
|
||||
fi
|
||||
|
||||
case $url in
|
||||
|
Loading…
Reference in New Issue
Block a user