Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
jarelllama authored Mar 28, 2024
1 parent 8f847f8 commit e551d47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
12 changes: 5 additions & 7 deletions parked.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
raw_file='data/raw_light.txt'



raw_file='data/raw.txt'
raw_light_file='data/raw_light.txt'
parked_terms_file='config/parked_terms.txt'
parked_domains_file='data/parked_domains.txt'
Expand All @@ -15,14 +12,14 @@ function main {
done
add_unparked_domains
remove_parked_domains
#update_light_file
update_light_file
}

function add_unparked_domains {
touch unparked_domains.tmp
printf "\nChecking for domains that have been unparked.\n"

# Split into 12 equal files
# Split into 10 equal files
split -d -l $(($(wc -l < "$parked_domains_file")/10)) "$parked_domains_file"
check_for_unparked "x00" "main" & check_for_unparked "x01" &
check_for_unparked "x02" & check_for_unparked "x03" &
Expand All @@ -46,7 +43,7 @@ function remove_parked_domains {
touch parked_domains.tmp
printf "\nChecking for parked domains.\n"

# Split into 12 equal files
# Split into 10 equal files
split -d -l $(($(wc -l < "$raw_file")/10)) "$raw_file"
check_for_parked "x00" "main" & check_for_parked "x01" &
check_for_parked "x02" & check_for_parked "x03" &
Expand Down Expand Up @@ -119,6 +116,7 @@ function format_list {

function cleanup {
find . -maxdepth 1 -type f -name "*.tmp" -delete
find . -maxdepth 1 -type f -name "x??" -delete
}

trap cleanup EXIT
Expand Down
2 changes: 1 addition & 1 deletion retrieve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ function main {
for file in config/* data/*; do # Format files in the config and data directory
format_list "$file"
done
printf "\n"
source
build
}

function source {
printf "\n"
# Check for existing pending domains file
[[ -d data/pending ]] && { use_pending=true; printf "Using existing lists of retrieved domains.\n\n"; }
[[ "$use_pending" == true ]] && source_manual # Retrieve manually added domains
Expand Down
4 changes: 2 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ function test_dead {
}

function test_parked {
# Requires at least 12 line to properly split
placeholder_lines=$(head -n 12 data/toplist.txt)
# At least 10 lines are required for proper split
placeholder_lines=$(head -n 10 data/toplist.txt)
printf "%s\n" "$placeholder_lines" > "$raw_file"
printf "%s\n" "$placeholder_lines" > "$parked_domains_file"

Expand Down

0 comments on commit e551d47

Please sign in to comment.