Skip to content
Snippets Groups Projects
Commit 9e15c34c authored by Jeremy Jarrell's avatar Jeremy Jarrell
Browse files

Adds the ability to parse users who should be whitelisted from the command line.

parent 5f8e01c4
Branches
Tags
No related merge requests found
...@@ -32,9 +32,16 @@ import chkcrontab_lib as check ...@@ -32,9 +32,16 @@ import chkcrontab_lib as check
def main(argv): def main(argv):
"""main program.""" """main program."""
if len(argv) != 2: if len(argv) == 1:
print('ERROR: No crontab file was specified.') print('ERROR: No crontab file was specified.')
sys.exit(1) sys.exit(1)
if len(argv) > 2:
for arg in argv:
if '--whitelist' in arg:
whitelist_users = arg['--whitelist='.__len__():].split(',')
log = check.LogCounter() log = check.LogCounter()
print('Checking correctness of %s' % argv[1]) print('Checking correctness of %s' % argv[1])
return check.check_crontab(argv[1], log) return check.check_crontab(argv[1], log)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment