Fixed bug - script now exits with code 3 if district/region is not found

This commit is contained in:
Jack-Benny Persson 2014-01-09 18:03:49 +01:00
parent b68349b3b4
commit 8870f5f7a7
2 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
2014-01-03 2014-01-03
Version 0.1 - First release of the plugin Version 0.1 - First release of the plugin
2013-01-04 2014-01-04
Version 0.2 - Fixed two bugs, whereas one important Version 0.2 - Fixed two bugs, whereas one important
1. In case there more than one wheater alert for the specified 1. In case there more than one wheater alert for the specified
region, the script would bug out. Fixed by adding 'head -n1' region, the script would bug out. Fixed by adding 'head -n1'
@ -10,6 +10,11 @@ Version 0.2 - Fixed two bugs, whereas one important
message they would output as their HTML-equivalent. Fixed message they would output as their HTML-equivalent. Fixed
with another sed substitue command. with another sed substitue command.
2013-01-09 2014-01-09
Version 0.3 - SMHI has changed österlen to Österlen in the text. Updated this Version 0.3 - SMHI has changed österlen to Österlen in the text. Updated this
in the hardcoded region/district names. in the hardcoded region/district names.
2014-01-09
Version 0.4 - Fixed an important bug. If the district/region did not exist
the script exited with a status 0 (OK). This should be status 3
(Unknown). This is now fixed.

View File

@ -21,7 +21,7 @@
################################################################################ ################################################################################
# check_smhi # check_smhi
Version="0.3" Version="0.4"
Author="Jack-Benny Persson (jack-benny@cyberinfo.se)" Author="Jack-Benny Persson (jack-benny@cyberinfo.se)"
# Binaries # Binaries
@ -195,6 +195,7 @@ done
if [ $Match -eq 0 ]; then if [ $Match -eq 0 ]; then
echo "District $District does not exist" echo "District $District does not exist"
print_help print_help
exit $State_unknown
fi fi