Skip to content

Commit

Permalink
v5.18.1 (#5618)
Browse files Browse the repository at this point in the history
  • Loading branch information
PromoFaux committed Mar 27, 2024
2 parents 3c7a6ce + 32c640e commit 74a44ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gravity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ gravity_DownloadBlocklistFromUrl() {
else
# Check if the file has a+r permissions
permissions=$(stat -c "%a" "$file_path")
if [[ $permissions == "??4" || $permissions == "??5" || $permissions == "??6" || $permissions == "??7" ]]; then
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}"
else
Expand Down

1 comment on commit 74a44ca

@akhepcat
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More elegant just to test for the read bit:

dperm=$((8#$permissions))
global_read=$(( $dperm & 4))
if [ $global_read -eq 4 ]; then printf "readable\n"; fi

Please sign in to comment.