summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosmosAtlas <zhuwenhan950913@gmail.com>2020-06-17 03:10:35 +0800
committerGitHub <noreply@github.com>2020-06-16 15:10:35 -0400
commite2203ed34f5f74b1d7b4651f35feaa86426bd087 (patch)
treed17f8397b2ed7c565e9f2c8875e90148c5065eca
parent44ea78692908d7aa54d2e1ed20314343c8db198a (diff)
changed ping address to a more friendly location (#399)
* changed ping address to a more friendly location `1.1.1.1` is not a friendly address for users from some parts of the world (e.g., China). Changed to `example.org` which should be more friendly to access. * changed internet check by fallback This is probably better since for most people it does the same thing and the first back up is Cloudfare's other DNS address which surprisingly can be accessed in more places (e.g., China) now. And changed the finall fallback as example.org.
-rwxr-xr-xbin/mailsync2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mailsync b/bin/mailsync
index 4050eba..93ec35d 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -8,7 +8,7 @@ pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync wil
pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}
# Checks for internet connection and set notification script.
-ping -q -c 1 1.1.1.1 > /dev/null || { echo "No internet connection detected."; exit ;}
+ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 example.org || { echo "No internet connection detected."; exit ;}
command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotify-send\` should be installed for pop-up mail notifications with this script."
# Required to display notifications if run as a cronjob: