git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keys: move key definitions into translation includes
[sheet.git]
/
tools
/
wget-ifmodified
diff --git
a/tools/wget-ifmodified
b/tools/wget-ifmodified
index bae00f158824bdcd91c3e4538778318d05d7a791..05967e1842744fd26be458bdcfa5e721d480146e 100755
(executable)
--- a/
tools/wget-ifmodified
+++ b/
tools/wget-ifmodified
@@
-4,11
+4,20
@@
set -u
if [ -z "$1" ]
then
if [ -z "$1" ]
then
- echo 'Usage: $0 <url> [<target>]' >&2
+ echo 'Usage: $0
[-v]
<url> [<target>]' >&2
# download url to target location if modified
exit 64 # EX_USAGE
fi
# download url to target location if modified
exit 64 # EX_USAGE
fi
+verbose=
+
+case "$1" in
+-v)
+ verbose=1
+ shift
+ ;;
+esac
+
source=$1
target=${2:-${source##*/}}
source=$1
target=${2:-${source##*/}}
@@
-16,7
+25,7
@@
if [ -e "$target" ]
then
modified=$(stat -c%y -L "$target") &&
modified=$(date -R -d "$modified")
then
modified=$(stat -c%y -L "$target") &&
modified=$(date -R -d "$modified")
- echo download since: $modified
+ [ $verbose ] && echo "download since: $modified"
fi
headers=${modified:+If-Modified-Since: $modified}
fi
headers=${modified:+If-Modified-Since: $modified}