diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-11-19 02:52:30 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-11-19 02:52:30 +0000 |
commit | 5003c48ab4760eab2f11f6f68a77e1890def1dfc (patch) | |
tree | 5d0b49351c42fc947fdf67c80e61d365d8488aed /usr | |
parent | 59eedf08bef6e43be67910d07995ee753f0ab77b (diff) | |
download | pfsense-5003c48ab4760eab2f11f6f68a77e1890def1dfc.zip pfsense-5003c48ab4760eab2f11f6f68a77e1890def1dfc.tar.gz |
add more($text) function. With this function it will ask the person to press return after 24 rows of output. Good for stuff like this:
$temp = print_r($config, true);
more($temp);
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/sbin/pfSsh.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index 0d77220..54d587a 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -13,11 +13,30 @@ require("config.inc"); echo "."; $g['booting'] = false; +function more($text) { + $counter=0; + $lines = split("\n", $text); + foreach($lines as $line) { + if($counter > 24) { + echo "Press RETURN to continue ..."; + $fp = fopen('php://stdin', 'r'); + $pressreturn = chop(fgets($fp)); + fclose($fp); + $counter = 0; + } + echo "{$line}\n"; + $counter++; + } +} + function show_help() { echo "\nExample commands:\n"; echo "\nparse_config(true); # reloads the \$config array\n"; - + + echo "\n\$temp = print_r(\$config, true);\n"; + echo "more(\$temp);\n"; + echo "\n/* to output a configuration array */\n"; echo "print_r(\$config);\n"; |