save initial command shell session output into session.info

git-svn-id: file:///home/svn/framework3/trunk@8829 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-03-16 04:50:47 +00:00
parent 7cf8b4c43f
commit f9267498e3
1 changed files with 10 additions and 0 deletions

View File

@ -216,6 +216,16 @@ class CommandShell
# Execute any specified auto-run scripts for this session
#
def process_autoruns(datastore)
# Read the initial output and mash it into a single line
initial_output = shell_read(-1, 0.01)
if (initial_output)
initial_output.gsub!(/[\r\n\t]+/, ' ')
initial_output.strip!
# Set the inital output to .info
self.info = initial_output
end
if (datastore['InitialAutoRunScript'] && datastore['InitialAutoRunScript'].empty? == false)
args = datastore['InitialAutoRunScript'].split
print_status("Session ID #{sid} (#{tunnel_to_s}) processing InitialAutoRunScript '#{datastore['InitialAutoRunScript']}'")