Return error, if oneliner service failed. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit bd2bee0857cd1561ac72a21cca90d38ba1961141 DIR parent 5fcc271628f2f43baad1ebb7c1eff44e3d179c2b HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Sat, 2 Jan 2021 16:28:07 +0100 Return error, if oneliner service failed. Diffstat: M oneliner | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- DIR diff --git a/oneliner b/oneliner @@ -12,11 +12,16 @@ do oneliner="$(curl -s "${uri}" \ | grep '</span></pre></font></div>' \ | sed 's,</span></pre></font></div>,,')" - if [ $tsvoutput -gt 0 ]; + if [ -z "${oneliner}" ]; then - printf "%s\t%s\n" "${oneliner}" "${uri}" + return 1 else - printf "%s ( %s )\n" "${oneliner}" "${uri}" + if [ $tsvoutput -gt 0 ]; + then + printf "%s\t%s\n" "${oneliner}" "${uri}" + else + printf "%s ( %s )\n" "${oneliner}" "${uri}" + fi fi done