From 9e15c34c61eb69e1aaf0d2fb80b7e3318a9dfa32 Mon Sep 17 00:00:00 2001
From: Jeremy Jarrell <jjarrell@listhub.com>
Date: Tue, 11 Jun 2013 15:01:54 -0400
Subject: [PATCH] Adds the ability to parse users who should be whitelisted
from the command line.
---
chkcrontab | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/chkcrontab b/chkcrontab
index e11510e..c9573c7 100755
--- a/chkcrontab
+++ b/chkcrontab
@@ -32,12 +32,19 @@ import chkcrontab_lib as check
def main(argv):
"""main program."""
- if len(argv) != 2:
+ if len(argv) == 1:
print('ERROR: No crontab file was specified.')
sys.exit(1)
+
+ if len(argv) > 2:
+ for arg in argv:
+ if '--whitelist' in arg:
+ whitelist_users = arg['--whitelist='.__len__():].split(',')
+
+
log = check.LogCounter()
print('Checking correctness of %s' % argv[1])
return check.check_crontab(argv[1], log)
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ sys.exit(main(sys.argv))
\ No newline at end of file
--
GitLab