summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-05-03 15:17:51 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-05-03 15:17:51 -0500
commit081f5f6c14ecde6fe689dac696a70eb40937a99d (patch)
treef517c368efb69e61531c96a02629b824c41a440e
parent64095a2983d8d31cf0702bf8c4553f71ef25ea4f (diff)
downloadvyatta-op-081f5f6c14ecde6fe689dac696a70eb40937a99d.tar.gz
vyatta-op-081f5f6c14ecde6fe689dac696a70eb40937a99d.zip
Add http as a url mode users can copy from
-rwxr-xr-xscripts/vyatta-image-tools.pl8
-rw-r--r--templates/copy/file/node.tag/node.def1
2 files changed, 8 insertions, 1 deletions
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://<user>:<passwd>@<host>/<file>
ftp://<user>:<passwd>@<host>/<file>
+ http://<user>:<passwd>@<host>/<file>
tftp://<host>/<file>
comptype: imagefiles
allowed: echo -n "<imagefiles>"