From 3d3be83663b7156f109a11500f82c079558000e9 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 19 Nov 2007 03:23:01 +0000 Subject: If readline is not included in PHP then fall back to normal boring text input methods. --- usr/local/sbin/pfSsh.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'usr/local/sbin/pfSsh.php') diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index 906be8f..72e313b 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -13,6 +13,15 @@ require("config.inc"); echo "."; $g['booting'] = false; +if(!function_exists("readline")) { + function readline() { + $fp = fopen('php://stdin', 'r'); + $textinput = chop(fgets($fp)); + fclose($fp); + } + return $textinput; +} + function more($text, $count=24) { $counter=0; $lines = split("\n", $text); @@ -97,7 +106,7 @@ $pkg_interface='console'; $shell_active = true; -echo "Type \"help\" to show common usage scnenarios."; +echo "Type \"help\" to show common usage scenarios."; while($shell_active == true) { $command = readline("\n\npfSense shell: "); -- cgit v1.1