dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit e4b4878ca0ed765d37c0aaf1250964719a8a99e2
parent d491eef594e243fff20bbf97a60ed5eb442586e4
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Tue, 15 May 2018 12:07:23 -0400

Only run vdirsyncer is we can talk to server

Diffstat:
M.local/lib/cron.avail/vdirsyncer.sh | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/.local/lib/cron.avail/vdirsyncer.sh b/.local/lib/cron.avail/vdirsyncer.sh @@ -1,4 +1,17 @@ #!/bin/sh echo "Beginning sync on `date`" -vdirsyncer sync + +server_fqdn="nextcloud.djmoch.org" + +# Only do the following if the server is reachable +if ping -c 1 $server_fqdn > /dev/null 2>&1 +then + echo "$server_fqdn reachable. Proceeding." +else + echo "$server_fqdn NOT reachable. Exiting." + exit -1 +fi + +vdirsyncer -v INFO sync + echo "Completed sync on `date`"