summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsyncrepo.sh (renamed from syncrepo)3
1 files changed, 2 insertions, 1 deletions
diff --git a/syncrepo b/syncrepo.sh
index dd72a94..25f8223 100755
--- a/syncrepo
+++ b/syncrepo.sh
@@ -16,7 +16,8 @@ lastupdate_url="http://mirror.pkgbuild.com/lastupdate"
exec 9>"${lock}"
flock -n 9 || exit
-if diff -b <(curl -s "$lastupdate_url") "$target/lastupdate" >/dev/null; then
+# if we are called without a tty (cronjob) only run when there are changes
+if ! tty -s && diff -b <(curl -s "$lastupdate_url") "$target/lastupdate" >/dev/null; then
exit 0
fi