fix regexp
[hband-tools.git] / óraállás-diktáló / aramszunet
blobcc53a96ceae6a9ed7b44dd3092accdde145babe8
1 #!/bin/bash
3 # EXIT CODES
4 # 0 - outage is not expected
5 # 10 - outage IS expected
6 # * - crawler error (see there)
8 set -u
10 telepules=$1
11 utca=$2
13 ./aramszunetek "$telepules" |\
14 html2text -utf8 |\
15 grep "$utca"
17 ps=(${PIPESTATUS[@]})
18 if [ ${ps[0]} != 0 ]
19 then
20 echo "crawler error" >&2
21 exit ${ps[0]}
22 else
23 if [ ${ps[2]} = 0 ]
24 then
25 echo "Áramszünet VÁRHATÓ" >&2
26 exit 10
27 else
28 echo "Áramszünet nem várható" >&2
29 exit 0