dgy
/
hexagons
Archived
1
0
Fork 0
This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
hexagons/bin/correo

26 lines
307 B
Plaintext
Raw Normal View History

2019-04-22 16:17:15 +00:00
#!/usr/bin/env bash
set -euf -o pipefail
# how long between checks
interval=${1:-600}
# check internet connection
connection() {
ping -q -c 1 1.1.1.1 > /dev/null || exit
}
checker() {
mailsync
sleep "$interval"
}
waiter() {
if ! connection ; then
sleep 30 && waiter
else
checker
fi
}
waiter