| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -252,27 +252,16 @@ class Gateway():
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  #===============================================================================
 | 
					 | 
					 | 
					 | 
					  #===============================================================================
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  def shutdown(self):
 | 
					 | 
					 | 
					 | 
					  def shutdown(self):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if self.use_ssh:
 | 
					 | 
					 | 
					 | 
					    self.ssh_close()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      try:
 | 
					 | 
					 | 
					 | 
					    try:
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        self.ssh.disconnect()
 | 
					 | 
					 | 
					 | 
					      self.ftp.quit()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      except Exception:
 | 
					 | 
					 | 
					 | 
					    except Exception:
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pass
 | 
					 | 
					 | 
					 | 
					      pass
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      try:
 | 
					 | 
					 | 
					 | 
					    try:
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        self.socket.close()
 | 
					 | 
					 | 
					 | 
					      self.ftp.close()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      except Exception:
 | 
					 | 
					 | 
					 | 
					    except Exception:
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pass
 | 
					 | 
					 | 
					 | 
					      pass
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    else:  
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      try:
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        self.ftp.quit()
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      except Exception:
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pass
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      try:
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        self.ftp.close()
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      except Exception:
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pass
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.ftp = None
 | 
					 | 
					 | 
					 | 
					    self.ftp = None
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.ssh = None
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.socket = None
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  #===============================================================================
 | 
					 | 
					 | 
					 | 
					  #===============================================================================
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  def init_memcfg(self, load_cfg = True):
 | 
					 | 
					 | 
					 | 
					  def init_memcfg(self, load_cfg = True):
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -464,6 +453,18 @@ class Gateway():
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      print("Can't found valid SSH server on IP {}".format(ip_addr))
 | 
					 | 
					 | 
					 | 
					      print("Can't found valid SSH server on IP {}".format(ip_addr))
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return -2  
 | 
					 | 
					 | 
					 | 
					    return -2  
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  def ssh_close(self):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    try:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      self.ssh.disconnect()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    except Exception:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      pass
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    try:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      self.socket.close()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    except Exception:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      pass
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    self.ssh = None
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    self.socket = None
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  def set_timeout(self, timeout):
 | 
					 | 
					 | 
					 | 
					  def set_timeout(self, timeout):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.timeout = timeout
 | 
					 | 
					 | 
					 | 
					    self.timeout = timeout
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if self.use_ssh and self.ssh:
 | 
					 | 
					 | 
					 | 
					    if self.use_ssh and self.ssh:
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |