summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-11-20 14:18:02 -0800
committerStig Thormodsrud <stig@vyatta.com>2010-11-20 14:18:02 -0800
commit6ece44025adc02f4a1144a5232c3edb0c20c66e0 (patch)
tree7b00a066f71f3933fbd0e1b72d131b59853ab08d /scripts
parente1d3d25fa3e3f2bda51d74cd73f390625b1d8d1c (diff)
downloadvyatta-config-mgmt-6ece44025adc02f4a1144a5232c3edb0c20c66e0.tar.gz
vyatta-config-mgmt-6ece44025adc02f4a1144a5232c3edb0c20c66e0.zip
Revert usage of libwww-curl-perl since it doesn't support scp.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-commit-push.pl18
1 files changed, 6 insertions, 12 deletions
diff --git a/scripts/vyatta-commit-push.pl b/scripts/vyatta-commit-push.pl
index 1105067..8b3e089 100755
--- a/scripts/vyatta-commit-push.pl
+++ b/scripts/vyatta-commit-push.pl
@@ -38,7 +38,6 @@ use POSIX;
use File::Compare;
use File::Copy;
use URI;
-use WWW::Curl::Easy;
use Sys::Hostname;
@@ -83,18 +82,13 @@ foreach my $uri (@uris) {
$remote .= "$scheme://$host";
$remote .= "$path" if defined $path;
print " $remote ";
- open(my $FILE, '<', $tmp_push_file) or die "Error: read $!";
- my $curl = new WWW::Curl::Easy;
- $curl->setopt(CURLOPT_NOPROGRESS, 1);
- $curl->setopt(CURLOPT_URL, "$uri/$save_file");
- $curl->setopt(CURLOPT_UPLOAD, 1);
- $curl->setopt(CURLOPT_INFILE, $FILE);
- $curl->setopt(CURLOPT_VERBOSE, $debug);
- my $retcode = $curl->perform;
- if ($retcode == 0) {
- print "Ok\n";
+ my $cmd = "curl -s -T $tmp_push_file $uri/$save_file";
+ print "cmd [$cmd]\n" if $debug;
+ my $rc = system($cmd);
+ if ($rc eq 0) {
+ print " OK\n";
} else {
- print "Failed: " . $curl->strerror($retcode) . "\n";
+ print " failed\n";
}
}
move($tmp_push_file, $last_push_file);