summaryrefslogtreecommitdiff
path: root/files/syncthing.fact
blob: 79ea6328ee3fb3e1ff15c13c53afb8577fbd9a99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl
###############################################################################
#     \_o<     WARNING : This file is being managed by ansible!      >o_/     #
#     ~~~~                                                           ~~~~     #
###############################################################################

use strict;
use warnings;

use JSON::PP;
use LWP::UserAgent;

my $id = '0000000-0000000-0000000-0000000-0000000-0000000-0000000-0000000';

my $resp = LWP::UserAgent->new()->head('http://localhost:8384/');
if ($resp->code == 200) {
	$id = $resp->header('X-Syncthing-Id');
}

my %output = (
	'id' => $id,
);
print encode_json \%output;