Exemple #1
0
	def killportprocess(self, port):
		a = os.popen(admin.getAdminExec("lsof -i :" + port + " -t", UserPasswd)).read()
		print(a)
		if a == None:
			return "Port is not in use"
		else:
			os.system("kill " + a)
Exemple #2
0
 def killportprocess(self, port):
     a = os.popen(admin.getAdminExec("lsof -i :" + port + " -t",
                                     UserPasswd)).read()
     print(a)
     if a == None:
         return "Port is not in use"
     else:
         os.system("kill " + a)
Exemple #3
0
	def getstatus(self, service):
		rawdata = os.popen(admin.getAdminExec("service " + service + " status", UserPasswd)).read()
		print(rawdata)
		if "start" in str(rawdata):
			print("Service is running!")
			return "Started"
		else:
			print("Service is stopped!")
			return "Stopped"
Exemple #4
0
	def getportprocess(self, port):
		pid = os.popen(admin.getAdminExec("lsof -i :" + port + " -t", UserPasswd)).read()
		print(pid)
		if pid == "":
			return False
		else:
			p = pid.rstrip()
			b = os.popen("ps -p " + p + " -o comm=").read()
			print(b)
			return b
Exemple #5
0
 def getstatus(self, service):
     rawdata = os.popen(
         admin.getAdminExec("service " + service + " status",
                            UserPasswd)).read()
     print(rawdata)
     if "start" in str(rawdata):
         print("Service is running!")
         return "Started"
     else:
         print("Service is stopped!")
         return "Stopped"
Exemple #6
0
 def getportprocess(self, port):
     pid = os.popen(
         admin.getAdminExec("lsof -i :" + port + " -t", UserPasswd)).read()
     print(pid)
     if pid == "":
         return False
     else:
         p = pid.rstrip()
         b = os.popen("ps -p " + p + " -o comm=").read()
         print(b)
         return b
Exemple #7
0
 def getStatus(self, rp):
     UserPassword = rp
     print('Getting Status')
     status = os.popen(admin.getAdminExec("ufw status",
                                          UserPassword)).read()
     return status
Exemple #8
0
	def getStatus(self, rp):
		UserPassword = rp
		print('Getting Status')
		status = os.popen(admin.getAdminExec("ufw status", UserPassword)).read()
		return status