def get_daemon(initfile):
""" Parse DAEMON variable in the init file """
re_daemon = re.compile('^DAEMON=(.+)$', re.MULTILINE)
if not exists(initfile):
return None
local_file = get(initfile)
f = open(local_file[0], 'r')
data = f.read()
f.close()
match = re_daemon.search(data)
daemon = ''
if match:
daemon = match.group(1)
if not exists(daemon):
return None
return daemon
评论列表
文章目录