Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Add logs in case we do not find any referer
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Jul 19, 2017
1 parent 6a3cbc3 commit 122c972
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions funceble
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ percentageLogOutput=${logOutput}percentage/
# Output of execution Time log
executionLog=${logOutput}execution.log

# Ouput of no referer log
noRefererLogOutput=${logOutput}noReferer/

# Output of inactive domain
outputInactiveHost=${inactiveHostsDir}${hostsDefault}

Expand Down Expand Up @@ -626,6 +629,23 @@ errorHandle()
fi
}

############################## No Referers Log #################################
# Used to generate the logs
#
# @CalledBy getReferer
################################################################################
noRefererLog(){
if [[ ${outputLogs} == true ]]
then
# We save the output of the captured date into log directory
printf "=%.0s" {1..100} >> ${noRefererLogOutput}.${domainExtension}
printf "\nNo referer found for: %s domains\n" "${domainExtension}" >> ${noRefererLogOutput}.${domainExtension}
printf "Tested domain: %s\n" "${initialDomain}" >> ${noRefererLogOutput}.${domainExtension}
printf "=%.0s" {1..100} >> ${noRefererLogOutput}.${domainExtension}
printf "\n" >> ${noRefererLogOutput}.${domainExtension}
fi
}

############################### Get Referer ####################################
# Used to generate the report issue url
#
Expand Down Expand Up @@ -703,6 +723,9 @@ getReferer(){
# We empty the referer variable
referer=''

# We log the issue
noRefererLog

# We handle error & check if server is up
errorHandle 'Error'
fi
Expand Down

0 comments on commit 122c972

Please sign in to comment.