Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (16 sloc) 777 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
use JSON qw/decode_json/;
use IO::All;
my $services_file = "/etc/biopay.json";
die "Couldn't find services file: $services_file!" unless -e $services_file;
my $service_content < io $services_file;
my $services = decode_json $service_content;
my $dancer_config_template = "/var/www/biopay/etc/config.yml";
my $dancer_config < io $dancer_config_template;
$dancer_config =~ s/\Q****____MERCHANT_ID____****\E/$services->{merchant_id}/;
$dancer_config =~ s/\Q****____MERCHANT_HASH_KEY____****\E/$services->{merchant_hash_key}/;
$dancer_config =~ s/\Q****____COUCH_URI____****\E/$services->{iriscouch_uri}/;
$dancer_config =~ s/\Q****____DEV_KEY____****\E/$services->{session_key}/;
$dancer_config > io "/var/www/biopay/config.yml";