Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jarelllama authored Apr 1, 2024
1 parent 0873e07 commit 25f993f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions functions/build_lists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,25 @@ readonly RAW='data/raw.txt'
readonly RAW_LIGHT='data/raw_light.txt'

build() {
# Set default comment character to '#'
[[ -z "$comment" ]] && comment='#'
comment=${comment:-'#'} # Set default comment character to '#'

mkdir -p "lists/${directory}"

# Loop through the full and light blocklist versions
for i in {1..2}; do
if [[ "$i" == '1' ]]; then
version=''
list_name='scams.txt'
source_file="$RAW"
elif [[ "$i" == '2' ]]; then
version='LIGHT VERSION'
list_name='scams_light.txt'
source_file="$RAW_LIGHT"
fi

blocklist_path="lists/${directory}/${list_name}"
blocklist_path="lists/${directory}/${list_name:-'scams.txt'}"

# Append header onto blocklist
cat << EOF > "$blocklist_path"
${comment} Title: Jarelllama's Scam Blocklist ${version}
${comment} Title: Jarelllama's Scam Blocklist ${version:-''}
${comment} Description: Blocklist for scam site domains automatically retrieved daily from Google Search and public databases.
${comment} Homepage: https://github.com/jarelllama/Scam-Blocklist
${comment} License: GNU GPLv3 (https://raw.githubusercontent.com/jarelllama/Scam-Blocklist/main/LICENSE.md)
Expand Down
2 changes: 1 addition & 1 deletion functions/check_dead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ format_file() {
}

cleanup() {
find . -maxdepth 1 -type f -name "*.tmp" -delete
find . -maxdepth 1 -type f -name '*.tmp' -delete

# Prune old entries from dead domains file
if (( $(wc -l < "$DEAD_DOMAINS") > 5000 )); then
Expand Down

0 comments on commit 25f993f

Please sign in to comment.