#!/usr/bin/perl
use strict;
use warnings;
# rsync --server -vltpre.iL --delete --force . /home/ousgg/sites-test/www.ousgg.org.uk
# rsync --server -vltpre.iL --delete --force . /home/ousgg/sites/www.ousgg.org.uk
my $rsync_re = qr/rsync/;
my $path_re = qr{/u3/d/worc2070/public_html/scripts};

unless( $#ARGV >= 2
    and $ARGV[0] =~ m{$rsync_re}
    and $ARGV[1] =~ m{^--server$}
    and $ARGV[-1] =~ m{$path_re} ){
    print "Rejected\n";
    exit( 99 );
} else {
    print $ENV{SSH_ORIGINAL_COMMAND};
    exit;
}

