From 74849ecfb6a6005169caf54b637e579407996b5b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 18 May 2011 13:54:48 +0200 Subject: Minor style fixes --- bin/ssh-forcecommand | 12 +++++++----- 1 file 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 \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; } -- cgit v1.2.3