From d08963ab6bd1cc1410da4b52b2aeed87a79930ac Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 14 Dec 2016 12:39:10 +0100 Subject: [PATCH] ovh-api --- bin/ovh-api | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/ovh-api b/bin/ovh-api index b4c3ff0b..22b4f1d6 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -32,7 +32,6 @@ my %Opt = ( 'method' => 'GET', ); get_options(\%Opt); -$main::_DATA_ = undef; # Auth if ($_ = $Opt{activate}) { exec qq|curl -s -XPOST -H"X-Ovh-Application: $_" -H "Content-type: application/json" https://eu.api.ovh.com/1.0/auth/credential -d '{"accessRules": [ { "method": "GET", "path": "/*" } ] }'|.'|jq .'; @@ -40,7 +39,7 @@ if ($_ = $Opt{activate}) { #exec("curl","-XPOST",'-H',"X-Ovh-Application: $_",'-H','Content-type: application/json','https://eu.api.ovh.com/1.0/auth/credential','-d',qq|'{"accessRules": [ { "method": "GET", "path": "/*" } ],"redirection":"https://www.mywebsite.com/" }'|); exit 0; } -help() unless @ARGV; +$main::_DATA_ = ''; ################################################################################# @@ -66,7 +65,7 @@ if (@ARGV and $ARGV[0] =~ /^(\w+):(\w+):(\w+)$/) { } @KEY or help(); -die map{"$_\n"} @KEY; +help() unless @ARGV; my $o = OvhApi->new(type => OvhApi::OVH_API_EU, applicationKey => $KEY[0], applicationSecret => $KEY[1], consumerKey => $KEY[2]); my $URL = shift @ARGV or help(); -- 2.47.3