summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-11-22 06:12:48 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-11-22 06:12:48 +0000
commit60ff86015d98afbc72620695e81715e9a33baa30 (patch)
treeb2c8e6e2ecd24bb8fb76c128e9e7cb629957de71 /usr
parent276356d4a16ec2bc3e9a437c6e03240f05693e31 (diff)
downloadpfsense-60ff86015d98afbc72620695e81715e9a33baa30.zip
pfsense-60ff86015d98afbc72620695e81715e9a33baa30.tar.gz
Collect the help file into one variable and then pipe through more()
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/sbin/pfSsh.php85
1 files changed, 46 insertions, 39 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php
index 40cc12d..9780438 100755
--- a/usr/local/sbin/pfSsh.php
+++ b/usr/local/sbin/pfSsh.php
@@ -73,61 +73,68 @@ function more($text, $count=24) {
}
function show_help() {
- echo "\nExample commands:\n";
+
+$show_help_text = <<<EOF
+ Example commands:
- echo "\nparse_config(true); # reloads the \$config array\n";
+ parse_config(true); # reloads the \$config array
- echo "\n\$temp = print_r(\$config, true);\n";
- echo "more(\$temp);\n";
+ \$temp = print_r(\$config, true);
+ more(\$temp);
- echo "\n/* to output a configuration array */\n";
- echo "print_r(\$config);\n";
+ /* to output a configuration array */
+ print_r(\$config);
+
+ /* to output the interfaces configuration portion of the configuration */
+ print_r(\$config['interfaces']);
- echo "\n/* to output the interfaces configuration portion of the configuration */\n";
- echo "print_r(\$config['interfaces']);\n";
+ /* to output the dhcp server configuration */
+ print_r(\$config['dhcpd']);
- echo "\n/* to output the dhcp server configuration */\n";
- echo "print_r(\$config['dhcpd']);\n";
+ /* to enable multiline input mode */
+ multiline
- echo "\n/* to enable multiline input mode */\n";
- echo "multiline\n";
+ /* to exit the php pfSense shell */
+ exit
- echo "\n/* to exit the php pfSense shell */\n";
- echo "exit\n";
+ /* to output supported wireless modes for an interface */
+ print_r(get_wireless_modes(\"ath0\"));
- echo "\n/* to output supported wireless modes for an interface */\n";
- echo "print_r(get_wireless_modes(\"ath0\"));\n";
+ /* to enable SSH */
+ \$config['system']['enablesshd'] = true;
- echo "\n/* to enable SSH */\n";
- echo "\$config['system']['enablesshd'] = true;\n";
+ /* change OPTX to the OPT interface name such as BACKHAUL */
+ \$config['interfaces']['optx']['wireless']['standard'] = \"11a\
+ \$config['interfaces']['optx']['wireless']['mode'] = \"hostap\
+ \$config['interfaces']['optx']['wireless']['channel'] = \"6\
- echo "\n/* change OPTX to the OPT interface name such as BACKHAUL */\n";
- echo "\$config['interfaces']['optx']['wireless']['standard'] = \"11a\";\n";
- echo "\$config['interfaces']['optx']['wireless']['mode'] = \"hostap\";\n";
- echo "\$config['interfaces']['optx']['wireless']['channel'] = \"6\";\n";
+ /* to enable dhcp server for an optx interface */
+ \$config['dhcpd']['optx']['enable'] = true;
+ \$config['dhcpd']['optx']['range']['from'] = \"192.168.31.100\
+ \$config['dhcpd']['optx']['range']['to'] = \"192.168.31.150\
- echo "\n/* to enable dhcp server for an optx interface */\n";
- echo "\$config['dhcpd']['optx']['enable'] = true;\n";
- echo "\$config['dhcpd']['optx']['range']['from'] = \"192.168.31.100\";\n";
- echo "\$config['dhcpd']['optx']['range']['to'] = \"192.168.31.150\";\n";
+ /* to disable the firewall filter */
+ \$config['system']['disablefilter'] = true;
- echo "\n/* to disable the firewall filter */\n";
- echo "\$config['system']['disablefilter'] = true;\n";
+ /* to enable an interface and set it for dhcp */
+ \$config['interfaces']['optx']['disabled'] = false;
+ \$config['interfaces']['optx']['ipaddr'] = \"dhcp\
- echo "\n/* to enable an interface and set it for dhcp */\n";
- echo "\$config['interfaces']['optx']['disabled'] = false;\n";
- echo "\$config['interfaces']['optx']['ipaddr'] = \"dhcp\";\n";
+ /* to enable an interface and set a static ip address */
+ \$config['interfaces']['wan']['disabled'] = false;
+ \$config['interfaces']['wan']['ipaddr'] = \"192.168.100.1\
+ \$config['interfaces']['wan']['subnet'] = \"24\
- echo "\n/* to enable an interface and set a static ip address */\n";
- echo "\$config['interfaces']['wan']['disabled'] = false;\n";
- echo "\$config['interfaces']['wan']['ipaddr'] = \"192.168.100.1\";\n";
- echo "\$config['interfaces']['wan']['subnet'] = \"24\";\n";
+ /* to save out the new configuration (config.xml) */
+ write_config();
- echo "\n/* to save out the new configuration (config.xml) */\n";
- echo "write_config();\n";
+ /* to reboot the system after saving */
+ system_reboot_sync();\n
- echo "\n/* to reboot the system after saving */\n";
- echo "system_reboot_sync();\n";
+EOF;
+
+ more($show_help_text);
+
}
$fp = fopen('php://stdin', 'r');
OpenPOWER on IntegriCloud