From 352d2a6829b4144ba1ad156c08f9b3332bc73d0f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 13 Nov 2014 22:56:06 +0100 Subject: [PATCH 1/1] Make the JSON output filename configurable. --- config.pm | 1 + remoteglot.pl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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 { -- 2.39.2