summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-29 23:49:37 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-29 23:49:37 +0000
commitd776e0778913fcd4989b35f78d79985bd245c321 (patch)
treece5283da456482cdaefc88302a59c498d3f15e0c /usr/local/sbin
parent07cae4b26ec0cddc34efdf89d70bf87c120d6d59 (diff)
downloadpfsense-d776e0778913fcd4989b35f78d79985bd245c321.zip
pfsense-d776e0778913fcd4989b35f78d79985bd245c321.tar.gz
Add a pfSense interactive php shell for developers.
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/pfSsh.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php
new file mode 100755
index 0000000..e2f9a05
--- /dev/null
+++ b/usr/local/sbin/pfSsh.php
@@ -0,0 +1,36 @@
+#!/usr/local/bin/php -f
+
+<?php
+
+echo "Starting the pfSense shell system";
+
+echo ".";
+require("globals.inc");
+$g['booting'] = true;
+require("functions.inc");
+echo ".";
+require("config.inc");
+echo ".";
+$g['booting'] = false;
+
+$fp = fopen('php://stdin', 'r');
+
+echo ".\n\n";
+
+$shell_active = true;
+
+echo "Example commands:\n\n";
+echo " print_r($config);\n";
+echo " \$config['interfaces']['lan']['ipaddr'] = \"192.168.1.1\";\n";
+echo " write_config();\n";
+
+while($shell_active == true) {
+ echo "\n\npfSense shell> ";
+ $command = chop(fgets($fp));
+ if($command == "exit") {
+ $shell_active = false;
+ echo "\n";
+ break;
+ }
+ eval($command);
+}
OpenPOWER on IntegriCloud