summaryrefslogtreecommitdiff
path: root/etc/mailsync.sh
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-03-16 12:14:51 -0700
committerLuke Smith <luke@lukesmith.xyz>2018-03-16 12:14:51 -0700
commit17b880131630de5686e126d528b80832843b7edc (patch)
treeeaf5fa48068e61c9892713e5ff30922de493b8b4 /etc/mailsync.sh
parent4abc05bfb55b012e5d4082423b0565b59f85a05c (diff)
parente9d16d64562c97914e91e4870a848874cfc28cb6 (diff)
Merge branch 'master' of github.com:LukeSmithxyz/mutt-wizard
Diffstat (limited to 'etc/mailsync.sh')
-rwxr-xr-xetc/mailsync.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/mailsync.sh b/etc/mailsync.sh
index 61eeade..4810ce7 100755
--- a/etc/mailsync.sh
+++ b/etc/mailsync.sh
@@ -7,8 +7,13 @@
#
# I have this run as a cronjob every 5 minutes.
-# Check for internet connection. Exit script if none.
-ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
+# Check for internet connection. Exit script if none. (timeout in mac is `-t`)
+if [ "$(uname)" == "Darwin" ]
+then
+ ping -q -t 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
+else
+ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
+fi
# Get current number of new mail, then begin sync.
ori=$(find ~/.mail -wholename '*/new/*' | grep -vi "spam\|trash\|junk" | wc -l)