From b67b850a7eb7287cf21546c07e78faa175069f0d Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 11 Oct 2013 10:15:27 +0100 Subject: [PATCH] Allow for redirects to ftp servers The Fedora image can redirect to a ftp server, in which case outputs a 213 if not modified. Change-Id: I714fc3562bf188994357e1918af309d8edeecde5 --- elements/cache-url/bin/cache-url | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elements/cache-url/bin/cache-url b/elements/cache-url/bin/cache-url index 3ac19369..0c12d2a4 100755 --- a/elements/cache-url/bin/cache-url +++ b/elements/cache-url/bin/cache-url @@ -46,7 +46,9 @@ if [ "$rcode" = "200" ] ; then echo $success mv $tmp $dest fi -elif [ "$rcode" = "304" ] ; then +# 213 is the response to a ftp MDTM command, curl outputs a 213 as the status +# if the url redirected to a ftp server and Not-Modified +elif [ "$rcode" = "304" -o "$rcode" = "213" ] ; then echo "Server copy has not changed. Using locally cached $url" rm -f $tmp else