summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mailsync2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/mailsync b/bin/mailsync
index 43429f5..8da6629 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -3,6 +3,8 @@
# Run only if user logged in (prevent cron errors)
pgrep -cu "$USER" >/dev/null || exit
+# Run only if not already running in other instance
+[ $(pgrep -xf "sh /usr/bin/mailsync" | wc -l) -eq 2 ] || exit
# Checks for internet connection and set notification script.
ping -q -c 1 1.1.1.1 > /dev/null || exit