diff options
author | V.Krishn <vkrishn4@gmail.com> | 2019-02-16 18:39:17 +0530 |
---|---|---|
committer | V.Krishn <vkrishn4@gmail.com> | 2019-02-16 18:39:17 +0530 |
commit | 9a063d11f42bf50349ff2e408ffaeadd55968e02 (patch) | |
tree | 4c2cd9dae23dd720c00a4bca2feb5daa89ea2b1a | |
parent | 44cd426a149ca34efdeed317609cea811059e37c (diff) | |
download | scripts-9a063d11f42bf50349ff2e408ffaeadd55968e02.tar.bz2 |
minor refactor, code clean
-rw-r--r-- | alpine/irc/log/get-irclog.sh | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/alpine/irc/log/get-irclog.sh b/alpine/irc/log/get-irclog.sh index 5114e9c..3f7d7b4 100644 --- a/alpine/irc/log/get-irclog.sh +++ b/alpine/irc/log/get-irclog.sh @@ -108,18 +108,6 @@ al_irclog2html() { num=$(($num+1)) done - _outf=$(echo ${_CURRLF} | cut -b2-).html - # _outf=/path/to/htdocs/${_outf} - - echo -e "${cGREEN}>>> creating ... ${cRED}$_outf${cNORMAL}" - rm -f ${_outf} - touch $_outf - - echo ${header} > ${_outf} - echo ${title} >> ${_outf} - echo ${style} >> ${_outf} - echo ${body} >> ${_outf} - echo -e "${cGREEN}>>> processing temp log:${cNORMAL} ${_tmpf}" sed -i \ -e 's|&|\&|g' \ @@ -149,19 +137,29 @@ al_irclog2html() { sed -E -i -e "s|${str}<|style=\'color\:${color}\'\>\<|g" \ ${_tmpf} done + + _outf=$(echo ${_CURRLF} | cut -b2-).html + # _outf=/path/to/htdocs/${_outf} + + echo -e "${cGREEN}>>> creating ... ${cRED}$_outf${cNORMAL}" + rm -f ${_outf}; touch $_outf + echo ${header} > ${_outf} + echo ${title} >> ${_outf} + echo ${style} >> ${_outf} + echo ${body} >> ${_outf} cat ${_tmpf} >> ${_outf} echo $footer >> ${_outf} } usage() { - echo -e ${cGREEN}; + echo -e ${cGREEN} cat <<-__EOF__ usage: get-irclogs Download IRC logs from Alpine Linux, and create a html format of the log __EOF__ - echo -e ${cNORMAL}; + echo -e ${cNORMAL} exit 1 } |