#!/usr/bin/perl

use strict;
use warnings;
use File::Copy;
use Data::Dumper;

my $dir_from = shift;
my $dir_to = shift;
my $files_from = shift;
my $files_to = shift;

$files_from =~ s/"//g;
$files_to =~ s/"//g;
$dir_from =~ s/"//g;
$dir_to =~ s/"//g;

if ($files_from eq '-') {
  
}


__END__
&& $files_to eq '-') {
  system("rsync -a \"$dir_from\" \"$dir_to/\"");
}
else {
  my @files_from = split /;/, $files_from;
  my @files_to = split /;/, $files_to;

  if (scalar @files_from > 1) {
    for (@files_from) {
      system("cp \"$_\" \"$files_to\"");
    }
  }
  elsif (scalar @files_from == 1) {
    for (@files_to) {
      system("cp \"".$files_from[0]."\" \"$_\"");
    }
  }
}

system("echo 1 > /tmp/filetools.refresh");

