remove vestigial Net::OpenSSH code
[scpubgit/Object-Remote.git] / lib / Object / Remote / Connector / LocalSudo.pm
CommitLineData
a9fdb55e 1package Object::Remote::Connector::LocalSudo;
2
3use Moo;
4
5extends 'Object::Remote::Connector::Local';
6
7around _perl_command => sub {
8 my ($orig, $self, $target_user) = @_;
9 return 'sudo', '-u', $target_user, $self->$orig($target_user);
10};
11
12push @Object::Remote::Connection::Guess, sub {
13 for ($_[0]) {
14 # username followed by @
15 if (defined and !ref and /^ ([^\@]*?) \@ $/x) {
16 return __PACKAGE__->new->connect($1);
17 }
18 }
19 return;
20};
21
221;