commit 292dd0c839e39f5cd5bebb784a6988d8ee4d0fda parent 494e0ff3a8a4550be095e08c4e38ef3e67753b10 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Mon, 30 Mar 2015 03:18:01 +0200 do not loop if file does not exist Diffstat:
notmuch-new.sh | | | 15 | +++++++++------ |
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/notmuch-new.sh b/notmuch-new.sh @@ -2,10 +2,13 @@ NEW_MAIL=~/temp/new_mail -while true -do - nice ionice -c 3 chrt --idle 0 /bin/sh -c "notmuch new && afew --tag --new" - sleep 1 - inotifywait $NEW_MAIL -done +if [ -f $NEW_MAIL ] +then + while true + do + nice ionice -c 3 chrt --idle 0 /bin/sh -c "notmuch new && afew --tag --new" + sleep 1 + inotifywait $NEW_MAIL + done +fi