From d4638abdc444f23b1870f3d58ec73d65cbed9ad0 Mon Sep 17 00:00:00 2001 From: aerth Date: Thu, 9 Feb 2017 11:15:54 -0800 Subject: [PATCH] Require 'fortune' program to be installed in $PATH --- add-fortune.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/add-fortune.sh b/add-fortune.sh index 7ff35d1..c981f0b 100755 --- a/add-fortune.sh +++ b/add-fortune.sh @@ -1,5 +1,10 @@ #!/bin/sh # double line separated fortunes. some get cut off but oh well. +if [ -z $(which fortune)]; then +echo "fortune program is not in \$PATH" +exit 1 +fi + echo "Populating fortunes.txt, press Ctrl C when you think its big enough." fortune >> fortunes.txt && echo "" >> fortunes.txt; fortune >> fortunes.txt && echo "" >> fortunes.txt;