From 081f5f6c14ecde6fe689dac696a70eb40937a99d Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 3 May 2011 15:17:51 -0500 Subject: Add http as a url mode users can copy from --- scripts/vyatta-image-tools.pl | 8 +++++++- templates/copy/file/node.tag/node.def | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/vyatta-image-tools.pl b/scripts/vyatta-image-tools.pl index 0e0f74a..3a9bf08 100755 --- a/scripts/vyatta-image-tools.pl +++ b/scripts/vyatta-image-tools.pl @@ -49,6 +49,9 @@ sub conv_file { } elsif ( lc($topdir) eq 'tftp') { $file = $filein; $topdir = 'url'; + } elsif ( lc($topdir) eq 'http') { + $file = $filein; + $topdir = 'url'; } elsif ( lc($topdir) eq 'ftp') { $file = $filein; $topdir = 'url'; @@ -105,6 +108,9 @@ sub url_copy { if (-d $from){ print "Cannot upload an entire directory to url\n"; exit 1; + } elsif ($to =~ /http/){ + print "Cannot upload to http url\n"; + exit 1; } curl_to($from, $to); } elsif ($f_topdir eq 'url') { @@ -179,7 +185,7 @@ sub update { sub rsync { my ($from,$to) = @_; - system("rsync -av --progress $from $to"); + system("rsync -a --progress $from $to"); } sub curl_to { diff --git a/templates/copy/file/node.tag/node.def b/templates/copy/file/node.tag/node.def index c52dccd..b19b788 100644 --- a/templates/copy/file/node.tag/node.def +++ b/templates/copy/file/node.tag/node.def @@ -1,6 +1,7 @@ help: Copy files from specified source scp://:@/ ftp://:@/ + http://:@/ tftp:/// comptype: imagefiles allowed: echo -n "" -- cgit v1.2.3