Split command output
This commit is contained in:
		
							parent
							
								
									85acee52af
								
							
						
					
					
						commit
						550f14b106
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -40,7 +40,7 @@ smb_active = 0
 | 
				
			||||||
smb_files = 0
 | 
					smb_files = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
    smbd_output = subprocess.check_output([SUDO, "lsof", "-c", "/^"+SMBD+"$/", "-Pcnt"], stderr=subprocess.DEVNULL).decode().split()
 | 
					    smbd_output = subprocess.check_output([SUDO, "lsof", "-c", "/^"+SMBD+"$/", "-Pcnt"], stderr=subprocess.DEVNULL).decode().split("\n")
 | 
				
			||||||
except subprocess.CalledProcessError as e:
 | 
					except subprocess.CalledProcessError as e:
 | 
				
			||||||
    # Error running process.
 | 
					    # Error running process.
 | 
				
			||||||
    pass
 | 
					    pass
 | 
				
			||||||
| 
						 | 
					@ -132,7 +132,7 @@ http_users = 0
 | 
				
			||||||
http_files = 0
 | 
					http_files = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
    http_output = subprocess.check_output([SUDO, "lsof", "-c", "/^"+APACHE+"$/", "-Pcnt"], stderr=subprocess.DEVNULL).decode().split()
 | 
					    http_output = subprocess.check_output([SUDO, "lsof", "-c", "/^"+APACHE+"$/", "-Pcnt"], stderr=subprocess.DEVNULL).decode().split("\n")
 | 
				
			||||||
except subprocess.CalledProcessError as e:
 | 
					except subprocess.CalledProcessError as e:
 | 
				
			||||||
    # Error running process.
 | 
					    # Error running process.
 | 
				
			||||||
    pass
 | 
					    pass
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue