Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use offlineimap's pid

  • Loading branch information...
commit 4221bc337ed6a7f0008ac3e7d10e4546c34ce699 1 parent 2b77bb8
@w0ng authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 mailrun
View
11 mailrun
@@ -3,10 +3,11 @@
# ~/bin/mailrun
#
-PID=$(pgrep offlineimap)
+read -r pid < ~/.offlineimap/pid
-[[ -n "$PID" ]] && kill "$PID"
+if ps $pid &>/dev/null; then
+ echo "offlineimap ($pid): another instance running." >&2
+ exit 1
+fi
-offlineimap -o -u quiet &>/dev/null &
-
-exit
+exec offlineimap -o -u quiet
Please sign in to comment.
Something went wrong with that request. Please try again.