summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-11-19 02:52:30 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-11-19 02:52:30 +0000
commit5003c48ab4760eab2f11f6f68a77e1890def1dfc (patch)
tree5d0b49351c42fc947fdf67c80e61d365d8488aed /usr
parent59eedf08bef6e43be67910d07995ee753f0ab77b (diff)
downloadpfsense-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-xusr/local/sbin/pfSsh.php21
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";
OpenPOWER on IntegriCloud