diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-11-22 01:04:35 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-11-22 01:04:35 +0000 |
commit | f9fd2b14d467b13756682ca3b571586e98c32675 (patch) | |
tree | cad02ef3ec1bc3739fc30ae89725759ff6f6e55f /usr/local/sbin | |
parent | 8182275e798641b061343a65eaefeca0bf15ee25 (diff) | |
download | pfsense-f9fd2b14d467b13756682ca3b571586e98c32675.zip pfsense-f9fd2b14d467b13756682ca3b571586e98c32675.tar.gz |
* Fix ! commands (do not echo commands but execute as shell)
* Fix grep commands in playback session for restart ftp helper
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-x | usr/local/sbin/pfSsh.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index 6725047..198ab96 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -156,14 +156,14 @@ while($shell_active == true) { $playback_file = $command_split[1]; if(!$playback_file || !file_exists("/etc/phpshellsessions/{$playback_file}")) { $command = ""; - echo "Could not locate playback file.\n"; + echo "\nCould not locate playback file.\n"; } else { $playback_file_contents = file_get_contents("/etc/phpshellsessions/{$playback_file}"); $playback_file_split = split("\n", $playback_file_contents); $playbackinprogress = true; $dontunsetplaybacksplit = true; $command = ""; - echo "\nPlayback of file {$command_split[1]} started.\n"; + echo "\n\nPlayback of file {$command_split[1]} started.\n"; } } if($command) @@ -188,7 +188,7 @@ while($shell_active == true) { $counter++; } if($playbackinprogress) - echo "\npfSense shell: {$command}\n"; + echo "\npfSense shell: {$command}\n\n"; if($recording) fwrite($recording_fd, $command . "\n"); system("$newcmd"); @@ -199,6 +199,13 @@ while($shell_active == true) { $command = ""; break; case "!": + $newcmd = ""; + $counter = 0; + foreach($command_split as $cs) { + if($counter > 0) + $newcmd .= " {$cs}"; + $counter++; + } system("$newcmd"); $command = ""; break; @@ -258,7 +265,7 @@ while($shell_active == true) { safe_mkdir("/etc/phpshellsessions"); $recording_fd = fopen("/etc/phpshellsessions/{$command_split[1]}","w"); if(!$recording_fd) { - echo "Could not start recording session.\n"; + echo "\nCould not start recording session.\n"; $command = ""; } else { $recording = true; @@ -270,7 +277,7 @@ while($shell_active == true) { if($command) { eval($command); if($playbackinprogress) - echo "\npfSense shell: {$command}\n"; + echo "\npfSense shell: {$command}\n\n"; if($recording) fwrite($recording_fd, $command . "\n"); } |