I would to find if the output of 'ps' command contain the process 'smtpd' The problem is that various busybox need different ps command! some need ' ps x ', other need ' ps w ' and other only the ' ps '
How i can make a universal algorithm that try all 'ps' possibilities ?
Example:
linex=''
foo=os.popen('ps')
for x in foo.readlines():
if x.lower().find('smtpd') != -1:
// SOME SCRIPT STUFF on linex string...
return linex
linex=''
foo=os.popen('ps w')
for x in foo.readlines():
if x.lower().find('smtpd') != -1:
// SOME SCRIPT STUFF on linex string...
return linex
linex=''
foo=os.popen('ps x')
for x in foo.readlines():
if x.lower().find('smtpd') != -1:
// SOME SCRIPT STUFF on linex string...
return linex