summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/pfSsh.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-11-09 02:09:35 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-11-09 02:09:35 +0000
commitebe2951eb681b73ce62b2bf2326492cab76ab526 (patch)
tree37ede418b358fb6757cb20fd7d94a8c82d68a8f0 /usr/local/sbin/pfSsh.php
parent7afeb359eaf2608e7a5457d9daf2625063a98c56 (diff)
downloadpfsense-ebe2951eb681b73ce62b2bf2326492cab76ab526.zip
pfsense-ebe2951eb681b73ce62b2bf2326492cab76ab526.tar.gz
Add libreadline support for command histories.
Requested-by: CMB
Diffstat (limited to 'usr/local/sbin/pfSsh.php')
-rwxr-xr-xusr/local/sbin/pfSsh.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php
index 05d11e0..0d77220 100755
--- a/usr/local/sbin/pfSsh.php
+++ b/usr/local/sbin/pfSsh.php
@@ -16,6 +16,8 @@ $g['booting'] = false;
function show_help() {
echo "\nExample commands:\n";
+ echo "\nparse_config(true); # reloads the \$config array\n";
+
echo "\n/* to output a configuration array */\n";
echo "print_r(\$config);\n";
@@ -77,13 +79,13 @@ $shell_active = true;
echo "Type \"help\" to show common usage scnenarios.";
while($shell_active == true) {
- echo "\n\npfSense shell> ";
- $command = chop(fgets($fp));
+ $command = readline("\n\npfSense shell: ");
if($command == "exit") {
$shell_active = false;
echo "\n";
break;
}
+ readline_add_history($command);
if($command == "help") {
show_help();
$command = "";
@@ -95,7 +97,8 @@ while($shell_active == true) {
$xxxyzyz = 0;
while($command <> "EOF") {
echo "pfSense multiline shell[$xxxyzyz]> ";
- $command = chop(fgets($fp));
+ $command = readline("Command: ");
+ readline_add_history($command);
if($command == "help")
show_help();
if($command == "exit")
OpenPOWER on IntegriCloud