Added error checking to jokes.
This commit is contained in:
parent
96b4400f5e
commit
0aaef3c43a
@ -1,5 +1,5 @@
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
joke="$(curl -s 'https://thatsagooden.tk/?api=txt&type=all&exclude=sex,little_johnny')"
|
||||
joke="$(curl -s --connect-timeout 5 'https://thatsagooden.tk/?api=txt&type=all&exclude=sex,little_johnny')"
|
||||
joke="${joke//[[:space:]]/ }"
|
||||
msg "$2" "$joke"
|
||||
[ -n "$joke" ] && msg "$2" "$joke" || msg "$2" "No jokes found."
|
||||
|
Loading…
Reference in New Issue
Block a user