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 | |
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
-rw-r--r-- | etc/phpshellsessions/restartftphelper | 6 | ||||
-rwxr-xr-x | usr/local/sbin/pfSsh.php | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/etc/phpshellsessions/restartftphelper b/etc/phpshellsessions/restartftphelper index ca5ab01..5b539fa 100644 --- a/etc/phpshellsessions/restartftphelper +++ b/etc/phpshellsessions/restartftphelper @@ -7,9 +7,9 @@ ! echo "Running php function system_start_ftp_helpers()..." system_start_ftp_helpers(); ! echo "Checking if ftp-proxy is running..." -= ps awux | grep "pftpx|ftp-proxy" += ps awux | grep "ftp-proxy" ! echo "Checking if pftpx is running..." -= ps awux | grep "pftpx|pftpx" += ps awux | grep "pftpx" ! echo "Checking if ftpsesame is running..." -= ps awux | grep "pftpx|ftpsesame" += ps awux | grep "ftpsesame" ! echo "Done." 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"); } |