#
# Usage: 
# Step 1: >> perl make_license_json.pl license.txt > license.json
# Step 2: >> repctl [-d <replicate_data_dir>] importlicense license_file=<location>license.json
#
# Enjoy! Hein van den Heuvel
#
$comma = q();              # Will become a a comma
for (<>) {
         next if /^\s*#/;       # Comment?
         if (/license_type=/) { # Looks like a license file?}
                 $license=1;
                 print qq({\n\t"cmd.license":\t{);  # Open up the JSON structure
         }
         next unless $license and /=/;
         chomp;                 # Remove New-line
         s/=/":"/;
         print qq(${comma}\n\t\t"${_}");
         $comma = q(,);         # Now it must become real
}
print qq(\n\t}\n}\n);      # And close the JSON structure
