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

Commit

Permalink
Introduction of ${outputLog} logic which make easy to deactive the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Mar 31, 2017
1 parent f50d4ec commit de6640c
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions funceble
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ outputLess=false
# Output unified file
outputUnified=true

# Output logs
outputLogs=true

# If set to true, we don't print anything
quiet=false

Expand Down Expand Up @@ -693,13 +696,17 @@ getReferer(){
# @CalledBy getExpirationDate
################################################################################
whoisLog(){
# We save the output of whois into log directory
printf "=%.0s" {1..100} >> ${whoisLogOutput}${referer}
printf "\n" >> ${whoisLogOutput}${referer}
cat ${whoIs} >> ${whoisLogOutput}${referer}
printf "\n" >> ${whoisLogOutput}${referer}
printf "=%.0s" {1..100} >> ${whoisLogOutput}${referer}
printf "\n" >> ${whoisLogOutput}${referer}
if [[ ${outputLogs} == true ]]
then

# We save the output of whois into log directory
printf "=%.0s" {1..100} >> ${whoisLogOutput}${referer}
printf "\n" >> ${whoisLogOutput}${referer}
cat ${whoIs} >> ${whoisLogOutput}${referer}
printf "\n" >> ${whoisLogOutput}${referer}
printf "=%.0s" {1..100} >> ${whoisLogOutput}${referer}
printf "\n" >> ${whoisLogOutput}${referer}
fi
}

############################## Date Format Log #################################
Expand All @@ -708,11 +715,14 @@ whoisLog(){
# @CalledBy formatDate
################################################################################
dateFormatlog(){
# We save the output of whois into log directory
printf "=%.0s" {1..100} >> ${dateLogOutput}${referer}
printf "\nExpiration Date:%s\n" "${expirationDate}" >> ${dateLogOutput}${referer}
printf "=%.0s" {1..100} >> ${dateLogOutput}${referer}
printf "\n" >> ${dateLogOutput}${referer}
if [[ ${outputLogs} == true ]]
then
# We save the output of whois into log directory
printf "=%.0s" {1..100} >> ${dateLogOutput}${referer}
printf "\nExpiration Date:%s\n" "${expirationDate}" >> ${dateLogOutput}${referer}
printf "=%.0s" {1..100} >> ${dateLogOutput}${referer}
printf "\n" >> ${dateLogOutput}${referer}
fi
}

####################### Get (Domain) Expiration Date ###########################
Expand Down Expand Up @@ -1251,7 +1261,7 @@ main()
################################################################################
usage()
{
echo "Usage: ${0} [ -a ] [ -ex ] [ --help ] [ -h ] [ -ip ] [ -q ] [ -n ] [ -p ] [ -nu ] [ --split ]"
echo "Usage: ${0} [ -a ] [ -ex ] [ --help ] [ -h ] [ -ip ] [ -q ] [ -n ] [ -p ] [ -nl ] [ -nu ] [ --split ]"
echo ""
echo " {[ -d domain-name.me ]} || {[ -f listOfDomainInAFile ]}"
echo ""
Expand All @@ -1265,7 +1275,8 @@ usage()
echo " --quiet -q Activate quiet mode (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo " --percentage -p Show the percentage of the results (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo " --noFiles -n Deactivate the production of output files (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo " --noUnified -nu Deactivate the production of result.txt as unified result under the outpur directory (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo " --noLogs -nl Deactivate the production of logs files in case we encouter some errors (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo " --noUnified -nu Deactivate the production of result.txt as unified result under the outpur directory (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo " --split Split output files (${red}${bold}Must be before ${white}-d${normal} ${red}${bold}or ${white}-f${normal})"
echo ""
echo "Examples:"
Expand Down

0 comments on commit de6640c

Please sign in to comment.