aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/pacsync
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin/pacsync')
-rwxr-xr-xdotfiles/.local/bin/pacsync5
1 files changed, 4 insertions, 1 deletions
diff --git a/dotfiles/.local/bin/pacsync b/dotfiles/.local/bin/pacsync
index 30fc98c..f96996a 100755
--- a/dotfiles/.local/bin/pacsync
+++ b/dotfiles/.local/bin/pacsync
@@ -1,10 +1,13 @@
#!/bin/sh
+# Don't try to sync if pacman is already running
if pidof pacman; then
exit
fi
-ping -q -c 1 1.1.1.1 > /dev/null || exit
+# Check several times before giving up, useful when just waking up from sleep
+# since internet is usually not available right away
+wget -q --tries=5 --timeout=20 --spider 1.1.1.1 > /dev/null || exit
# Source the needed env variables so that it can function properly from cron
. ~/.cache/sessionenv