ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
Log | Files | Refs | README | LICENSE

commit 67abd23934ba7e7a9af9407836ca6983bd046c0c
parent 3a4f2ce6367fb3ae7df4a57a7afc6c1f22070bc7
Author: Allan Odgaard <git@abetarda.com>
Date:   Mon,  4 Jan 2016 11:13:41 +0100

Exit with non-zero return code on failure

This is useful for non-interactive use where the caller may want to retry on failure.

The exit codes used are from sysexits.h.

Diffstat:
Mansiweather | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ansiweather b/ansiweather @@ -96,14 +96,14 @@ jqpath=$(which jq) if [ "$jqpath" = "" ] then echo "ERROR : Cannot find jq binary" - exit + exit 69 # EX_UNAVAILABLE fi bcpath=$(which bc) if [ "$bcpath" = "" ] then echo "ERROR : Cannot find bc binary" - exit + exit 69 # EX_UNAVAILABLE fi @@ -188,7 +188,7 @@ fi if [ -z "$weather" ] then echo "ERROR : Cannot fetch weather data" - exit + exit 75 # EX_TEMPFAIL fi status_code=$(echo "$weather" | jq -r '.cod' 2>/dev/null) @@ -196,7 +196,7 @@ status_code=$(echo "$weather" | jq -r '.cod' 2>/dev/null) if [ "$status_code" != 200 ] then echo "ERROR : Cannot fetch weather data for the given location" - exit + exit 69 # EX_UNAVAILABLE fi