Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jarelllama authored Apr 2, 2024
1 parent 94ac96a commit 0874308
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 31 deletions.
12 changes: 6 additions & 6 deletions functions/check_dead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,17 @@ find_dead() {
}

# Function 'log_event' logs domain processing events into the domain log.
# $1: domains to log stored in a variable.
# $2: event type (dead, whitelisted, etc.)
# $3: source
# $1: domains to log stored in a variable.
# $2: event type (dead, whitelisted, etc.)
# $3: source
log_event() {
printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \
'{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG"
}

# Function 'format_file' calls a shell wrapper to
# standardize the format of a file.
# $1: file to format
# Function 'format_file' calls a shell wrapper to standardize the format
# of a file.
# $1: file to format
format_file() {
bash functions/tools.sh format "$1"
}
Expand Down
12 changes: 6 additions & 6 deletions functions/check_parked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ find_parked() {
}

# Function 'log_event' logs domain processing events into the domain log.
# $1: domains to log stored in a variable
# $2: event type (dead, whitelisted, etc.)
# $3: source
# $1: domains to log stored in a variable.
# $2: event type (dead, whitelisted, etc.)
# $3: source
log_event() {
printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \
'{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG"
}

# Function 'format_file' calls a shell wrapper to
# standardize the format of a file.
# $1: file to format
# Function 'format_file' calls a shell wrapper to standardize the format
# of a file.
# $1: file to format
format_file() {
bash functions/tools.sh format "$1"
}
Expand Down
25 changes: 12 additions & 13 deletions functions/retrieve_domains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,6 @@ decide_exit() {
fi
}

# Function 'log_event' logs domain processing events into the domain log.
# $1: domains to log stored in a variable
# $2: event type (dead, whitelisted, etc.)
# $3: source
log_event() {
[[ -n "$3" ]] && local source="$3"
printf "%s\n" "$1" | awk -v type="$2" -v source="$source" -v time="$TIME_FORMAT" \
'{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG"
}

# Function 'log_source' prints and logs statistics for each source.
# The variables should be declared before running this function,
# otherwise, the default values are used.
Expand All @@ -287,9 +277,18 @@ ${query_count:-0},${rate_limited:-false}",no >> "$SOURCE_LOG"
printf "%s\n" "----------------------------------------------------------------------"
}

# Function 'format_file' calls a shell wrapper to
# standardize the format of a file.
# $1: file to format
# Function 'log_event' logs domain processing events into the domain log.
# $1: domains to log stored in a variable.
# $2: event type (dead, whitelisted, etc.)
# $3: source
log_event() {
printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \
'{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG"
}

# Function 'format_file' calls a shell wrapper to standardize the format
# of a file.
# $1: file to format
format_file() {
bash functions/tools.sh format "$1"
}
Expand Down
12 changes: 6 additions & 6 deletions functions/validate_raw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ validate_raw() {
}

# Function 'log_event' logs domain processing events into the domain log.
# $1: domains to log stored in a variable
# $2: event type (dead, whitelisted, etc.)
# $3: source
# $1: domains to log stored in a variable.
# $2: event type (dead, whitelisted, etc.)
# $3: source
log_event() {
printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \
'{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG"
}

# Function 'format_file' calls a shell wrapper to
# standardize the format of a file.
# $1: file to format
# Function 'format_file' calls a shell wrapper to standardize the format
# of a file.
# $1: file to format
format_file() {
bash functions/tools.sh format "$1"
}
Expand Down

0 comments on commit 0874308

Please sign in to comment.