From: Steinar H. Gunderson Date: Thu, 13 Nov 2014 21:56:06 +0000 (+0100) Subject: Make the JSON output filename configurable. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=352d2a6829b4144ba1ad156c08f9b3332bc73d0f Make the JSON output filename configurable. --- diff --git a/config.pm b/config.pm index b9422e6..2c3bedf 100644 --- a/config.pm +++ b/config.pm @@ -7,6 +7,7 @@ package remoteglotconf; our $server = "freechess.org"; our $nick = "SesseBOT"; our $target = "GMCarlsen"; +our $json_output = "/srv/analysis.sesse.net/www/analysis.json"; our $engine_cmdline = "./stockfish"; our %engine_config = ( diff --git a/remoteglot.pl b/remoteglot.pl index dd913f6..10dead9 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -588,11 +588,11 @@ sub output_json { } $json->{'refutation_lines'} = \%refutation_lines; - open my $fh, ">/srv/analysis.sesse.net/www/analysis.json.tmp" + open my $fh, ">", $remoteglotconf::json_output . ".tmp" or return; print $fh JSON::XS::encode_json($json); close $fh; - rename("/srv/analysis.sesse.net/www/analysis.json.tmp", "/srv/analysis.sesse.net/www/analysis.json"); + rename($remoteglotconf::json_output . ".tmp", $remoteglotconf::json_output); } sub uciprint {