summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-10-24 00:32:46 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-10-24 00:32:46 +0000
commit4c12ef0a4f7e819c91f0a720d1d85490798332d5 (patch)
treedf6fba29e1db8a8346bfcd5e4671663bea346b23 /usr
parentab757ebc84bc243785b54d085a549348af701366 (diff)
downloadpfsense-4c12ef0a4f7e819c91f0a720d1d85490798332d5.zip
pfsense-4c12ef0a4f7e819c91f0a720d1d85490798332d5.tar.gz
Break out item that can be its own function
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/sbin/pfSsh.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php
index 3bcb7ef..93c8f89 100755
--- a/usr/local/sbin/pfSsh.php
+++ b/usr/local/sbin/pfSsh.php
@@ -100,7 +100,7 @@ $show_help_text = <<<EOF
/* to output a configuration array */
print_r(\$config);
- /* to output the interfaces configuration portion of the configuration */
+ /* to output the interfaces configuration portion of config.xml */
print_r(\$config['interfaces']);
/* to output the dhcp server configuration */
@@ -200,9 +200,8 @@ while($shell_active == true) {
continue;
}
}
- if($first_command == "exit" or $first_command == "quit") {
+ if($first_command == "exit" or $first_command == "quit")
die;
- }
if($first_command == "help" or $first_command == "?") {
show_help();
$playbackbuffer = "";
@@ -227,14 +226,8 @@ while($shell_active == true) {
}
}
if($first_command == "showrecordings") {
- conf_mount_rw();
- safe_mkdir("/etc/phpshellsessions");
- if($recording)
- conf_mount_ro();
- echo "==> Sessions available for playback are:\n";
- system("cd /etc/phpshellsessions && ls /etc/phpshellsessions");
- echo "==> end of list.\n";
- $command = "";
+ show_recordings();
+ $command = "";
}
if($first_command == "reset") {
$playbackbuffer = "";
@@ -263,6 +256,16 @@ while($shell_active == true) {
$playbackbuffer .= $command . "\n";
}
+function show_recordings() {
+ conf_mount_rw();
+ safe_mkdir("/etc/phpshellsessions");
+ if($recording)
+ conf_mount_ro();
+ echo "==> Sessions available for playback are:\n";
+ system("cd /etc/phpshellsessions && ls /etc/phpshellsessions");
+ echo "==> end of list.\n";
+}
+
function returnlastchar($command) {
$commandlen = strlen($command);
$endofstring = substr($command, ($commandlen-1));
OpenPOWER on IntegriCloud