diff options
author | Michael Scherer <misc@mageia.org> | 2012-01-20 23:05:57 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-01-20 23:05:57 +0000 |
commit | a4cc319ca0a64b1b20bb0eac450e4421aff0624b (patch) | |
tree | 36f60d4c5d5ad4090e4b6f0f3cb558d6fa987400 /modules/mirror/templates | |
parent | 694613924e7f4b4752855f9f549ccbf114bea4db (diff) | |
download | puppet-a4cc319ca0a64b1b20bb0eac450e4421aff0624b.tar puppet-a4cc319ca0a64b1b20bb0eac450e4421aff0624b.tar.gz puppet-a4cc319ca0a64b1b20bb0eac450e4421aff0624b.tar.bz2 puppet-a4cc319ca0a64b1b20bb0eac450e4421aff0624b.tar.xz puppet-a4cc319ca0a64b1b20bb0eac450e4421aff0624b.zip |
better error message when a sync is running, but only show when run
from command line
Diffstat (limited to 'modules/mirror/templates')
-rw-r--r-- | modules/mirror/templates/mirrordir | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/mirror/templates/mirrordir b/modules/mirror/templates/mirrordir index 5d2ad401..53655aa0 100644 --- a/modules/mirror/templates/mirrordir +++ b/modules/mirror/templates/mirrordir @@ -5,8 +5,12 @@ localdir="<%= localdir %>" rsync_options="<%= rsync_options %>" lockfile="<%= lockfile %>" -test -f "$lockfile" && echo "sync already in progress" && exit -touch "$lockfile" +if [ -f "$lockfile" ]; then + # show error message when run from command line + [ -t 1 ] && cat $lockfile + exit +fi +echo "sync in progress since $(date)" > "$lockfile" /usr/bin/rsync $rsync_options "$remoteurl" "$localdir" rm -f "$lockfile" |