2016-09-03 19:38:05 -04:00
|
|
|
[ -f functions.sh ] && source functions.sh
|
2016-09-03 18:57:19 -04:00
|
|
|
|
2016-09-03 19:38:05 -04:00
|
|
|
unset fortune
|
|
|
|
unset target
|
|
|
|
fortune="$(command -v fortune)"
|
|
|
|
if [ $# -ge 2 ]; then
|
|
|
|
target="$3"
|
|
|
|
fi
|
2016-09-03 18:57:19 -04:00
|
|
|
|
2016-09-03 19:38:05 -04:00
|
|
|
if [ -z "$fortune" ]; then
|
|
|
|
msg "$2" "I do not have access to fortune."
|
|
|
|
else
|
|
|
|
msg "$2" "$($fortune -aesn 512 $target | tr '[:space:]' ' ' | sed -e 's/"/\"/g')"
|
|
|
|
fi
|