diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-18 13:54:48 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-18 13:54:48 +0200 |
commit | 74849ecfb6a6005169caf54b637e579407996b5b (patch) | |
tree | aa3d2f70e24611e167fd3181c8ed45b7b002fe91 /bin | |
parent | 344455fe2dbfd2ec176be00b1c35f7a95844f2ca (diff) |
Minor style fixes
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ssh-forcecommand | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/ssh-forcecommand b/bin/ssh-forcecommand index 892be55..70f9366 100755 --- a/bin/ssh-forcecommand +++ b/bin/ssh-forcecommand @@ -3,23 +3,25 @@ use strict; use warnings; my $conffile = shift or die("Usage: $0 <configfile>\n"); -my %commands; -my $input = $ENV{'SSH_ORIGINAL_COMMAND'} or die("No command\n");; +my $input = $ENV{SSH_ORIGINAL_COMMAND} or die("No command\n");; +my %command; my $VERSION = '0.0'; open(my $conf, '<', $conffile) or die("Can't open $conffile: $!\n"); while (my $line = <$conf>) { my ($key, $value) = ($line =~ m{ ^ ([^=]+?) \s* = \s* (.+) $ }x); + if ($key and $value) { - $commands{$key} = $value; + $command{$key} = $value; } } close($conf) or die("Cannot close $conffile: $!\n"); -if (exists $commands{$input}) { - exec($commands{$input}); + +if ($command{$input}) { + exec($command{$input}); exit 1; } |