1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 # rsync --server -vltpre.iL --delete --force . /home/ousgg/sites-test/www.ousgg.org.uk
5 # rsync --server -vltpre.iL --delete --force . /home/ousgg/sites/www.ousgg.org.uk
6 my $rsync_re = qr/rsync/;
7 my $path_re = qr{/u3/d/worc2070/public_html/scripts};
8
9 unless( $#ARGV >= 2
10 and $ARGV[0] =~ m{$rsync_re}
11 and $ARGV[1] =~ m{^--server$}
12 and $ARGV[-1] =~ m{$path_re} ){
13 print "Rejected\n";
14 exit( 99 );
15 } else {
16 print $ENV{SSH_ORIGINAL_COMMAND};
17 exit;
18 }
syntax highlighted by Code2HTML, v. 0.9.1