示例#1
0
def stop_tornado():
	for port in PORTS:
		s = Screen(TORNADO_SCREEN.format(port=port))
		if s.exists:
			s.interrupt()
			s.kill()
	info('Stopping tornado instance(s).')
示例#2
0
 def stop(self):
     """
     Method to stop the server.
     """
     # Steam appid
     steam_appid = self.gsconfig['steamcmd']['appid']
     if self.status():
         s = Screen(steam_appid)
         s.kill()
         print "Server stopped."
     else:
         print "Server is not running."
示例#3
0
 def stop(self):
     """
     Method to stop the server.
     """
     # Steam appid
     steam_appid = self.gsconfig['steamcmd']['appid']
     if self.status():
         s = Screen(steam_appid)
         s.kill()
         print "Server stopped."
     else:
        print "Server is not running."
session_Name = 'session1'
s1 = Screen(session_Name, True)

if not s1.exists:
    raise RuntimeError("ERROR: Session not started: %s" % session_Name)

time.sleep(5000)
# funky prompts could reduce log visibility. Use sh or bash for best results
s1.send_commands('bash')
s1.enable_logs()
s1.send_commands("df")
print(next(s1.logs))

s1.disable_logs()

# s1 = None
# s1 = Screen("session1")
# s1.exists

s1.kill()

# s2
s2 = Screen("session2")
s2.exists
s2.initialize()
s2.exists

print(list_screens())

s2.kill()