Function ssh_Initialize(msgPort As Object, userVariables As Object, bsp as Object)
'no spaces in names

    print "ssh_Initialize - entry"

    ssh = newssh(msgPort, userVariables, bsp)
    sshon()

    return ssh

End Function


Function newssh(msgPort As Object, userVariables As Object, bsp as Object)
	print "newssh"

	s = {}
	s.version = 0.1
	s.msgPort = msgPort
	s.userVariables = userVariables
	s.bsp = bsp
	s.ProcessEvent = ssh_ProcessEvent
	s.objectName = "ssh_object"
	s.debug  = true
	return s
End Function


Function ssh_ProcessEvent(event As Object) as boolean
	print "ssh_processevent"
	
	retval = false

	if type(event) = "roHttpEvent" then

	else if type(event) = "roTimerEvent" then

	end if

	return retval

End Function


Sub sshoff()
	registrySection = CreateObject("roRegistrySection", "networking")
	if type(registrySection)<>"roRegistrySection" then 
		print "Error: Unable to create roRegistrySection"
		
	else
		registrySection.Write("ssh", " ")
		registrySEction.flush()
		registrySection=invalid
		'rebootsystem()	'might want to reboot manually
	endif
End Sub

Sub sshon()
	registrySection = CreateObject("roRegistrySection", "networking")
	if type(registrySection)<>"roRegistrySection" then 
		print "Error: Unable to create roRegistrySection"
		
	else

		registrySection.Write("ssh", "22")
		registrySEction.flush()
		registrySection=invalid

		n=CreateObject("roNetworkConfiguration", 0)	'0 is ethernet, 1 would be wireless
		if n <> invalid then 
			n.SetLoginPassword("password")
		else
			print "unable to create network object for ethernet"
		endif


		'rebootsystem()	'might want to reboot manually
	endif
End Sub






