projects
/
bak-git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c8b008
)
generate client-side shell script
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 17 Feb 2010 19:38:31 +0000
(20:38 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 17 Feb 2010 19:38:31 +0000
(20:38 +0100)
server.pl
patch
|
blob
|
history
diff --git
a/server.pl
b/server.pl
index
bf8e56d
..
b158748
100755
(executable)
--- a/
server.pl
+++ b/
server.pl
@@
-1,5
+1,8
@@
#!/usr/bin/perl
+# install on client with:
+# echo install | nc 10.60.0.92 9001 > bak ; chmod 755 bak
+
use warnings;
use strict;
use autodie;
@@
-22,6
+25,11
@@
while (my $client = $server->accept()) {
my ($command,$path,$message) = split(/\s+/,<$client>,3);
my $ip = $client->peerhost;
+ if ( $command eq 'install' ) {
+ print $client '#!/bin/sh',$/,'echo $* | nc 10.60.0.92 9001',$/;
+ next;
+ }
+
warn "$ip [$command] $path | $message\n";
if ( ! -d $ip ) {