summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-11-22 01:26:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-11-22 01:26:28 +0000
commitda30a386c916efbeee3b3bc699cf9c6df5ade37b (patch)
treea1c4bb5a1b5bc94961ec1c90b80fcff3cd85b3c2 /usr
parent36ecb27357c6f39d3dbbde70f245b8561d7f76de (diff)
downloadpfsense-da30a386c916efbeee3b3bc699cf9c6df5ade37b.zip
pfsense-da30a386c916efbeee3b3bc699cf9c6df5ade37b.tar.gz
Really cleanup c/r usage.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/sbin/pfSsh.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php
index 198ab96..40cc12d 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 "\nCould not locate playback file.\n";
+ echo "Could 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 "\n\nPlayback of file {$command_split[1]} started.\n";
+ echo "Playback of file {$command_split[1]} started.\n\n";
}
}
if($command)
@@ -188,15 +188,16 @@ while($shell_active == true) {
$counter++;
}
if($playbackinprogress)
- echo "\npfSense shell: {$command}\n\n";
+ echo "pfSense shell: {$command}\n\n";
if($recording)
fwrite($recording_fd, $command . "\n");
system("$newcmd");
if($command_split[1] == "cd") {
- echo "\nChanging working directory to {$command_split[2]}.\n";
+ echo "Changing working directory to {$command_split[2]}.\n";
chdir($command_split[2]);
}
$command = "";
+ echo "\n";
break;
case "!":
$newcmd = "";
@@ -207,6 +208,7 @@ while($shell_active == true) {
$counter++;
}
system("$newcmd");
+ echo "\n";
$command = "";
break;
}
@@ -215,7 +217,7 @@ while($shell_active == true) {
$command = "";
}
if($command == "multiline" or $command == "ml") {
- echo "\nmultiline mode enabled. enter EOF on a blank line to execute.\n\n";
+ echo "multiline mode enabled. enter EOF on a blank line to execute.\n\n";
$command = "";
$mlcommand = "";
$xxxyzyz = 0;
@@ -238,10 +240,10 @@ while($shell_active == true) {
fclose($recording_fd);
$command = "";
conf_mount_ro();
- echo "\nRecording stopped.\n";
+ echo "Recording stopped.\n";
$recording = false;
} else {
- echo "\nNo recording session in progress.\n";
+ echo "No recording session in progress.\n";
$command = "";
}
}
@@ -250,9 +252,9 @@ while($shell_active == true) {
safe_mkdir("/etc/phpshellsessions");
if($recording)
conf_mount_ro();
- echo "\n==> Sessions available for playback are:\n\n";
+ echo "==> Sessions available for playback are:\n\n";
system("cd /etc/phpshellsessions && ls /etc/phpshellsessions");
- echo "\n==> end of list.\n";
+ echo "==> end of list.\n";
$command = "";
}
if($command_split[0] == "record") {
@@ -265,11 +267,11 @@ while($shell_active == true) {
safe_mkdir("/etc/phpshellsessions");
$recording_fd = fopen("/etc/phpshellsessions/{$command_split[1]}","w");
if(!$recording_fd) {
- echo "\nCould not start recording session.\n";
+ echo "Could not start recording session.\n";
$command = "";
} else {
$recording = true;
- echo "\nRecording of {$command_split[1]} started.\n";
+ echo "Recording of {$command_split[1]} started.\n";
$command = "";
}
}
@@ -277,7 +279,7 @@ while($shell_active == true) {
if($command) {
eval($command);
if($playbackinprogress)
- echo "\npfSense shell: {$command}\n\n";
+ echo "pfSense shell: {$command}\n\n";
if($recording)
fwrite($recording_fd, $command . "\n");
}
OpenPOWER on IntegriCloud