X-Git-Url: https://git.defcon.no/?a=blobdiff_plain;f=guc-clients%2Fadd_apikey.pl;h=ce303bdadb9c54d0af080302667552d4c5eb3a30;hb=HEAD;hp=a543c23023414ed0c6be6c081db88481e4c7ac15;hpb=26723586ae1875f592470e77629924081e369996;p=hermes diff --git a/guc-clients/add_apikey.pl b/guc-clients/add_apikey.pl index a543c23..ce303bd 100755 --- a/guc-clients/add_apikey.pl +++ b/guc-clients/add_apikey.pl @@ -13,13 +13,21 @@ my $level = ""; my $keyfile =""; my $api_base = ""; my $api_key = ""; -my $configfile; +my $configfile = undef; my $config = AppConfig->new( { CREATE => 1 } ); $config->define("api_url=s"); $config->define("api_keyfile=s"); +foreach ( + "/usr/local/etc/hermes/hermes_config", + "/usr/local/etc/hermes/config", + "/etc/hermes/config", + $ENV{"HOME"} . "/.hermes/config", + $ENV{"HOME"} . "/.hermes_config", +) { $configfile = $_ if ( -f $_ ); } + GetOptions( "help" => \$help, "host=s" => \$host_ip,