diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-24 00:32:46 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-24 00:32:46 +0000 |
commit | 4c12ef0a4f7e819c91f0a720d1d85490798332d5 (patch) | |
tree | df6fba29e1db8a8346bfcd5e4671663bea346b23 /usr | |
parent | ab757ebc84bc243785b54d085a549348af701366 (diff) | |
download | pfsense-4c12ef0a4f7e819c91f0a720d1d85490798332d5.zip pfsense-4c12ef0a4f7e819c91f0a720d1d85490798332d5.tar.gz |
Break out item that can be its own function
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/sbin/pfSsh.php | 25 |
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)); |