def main(): argc = len(sys.argv) if (argc != 2): usage() # We want our children to die quietly signal.signal(signal.SIGCHLD, signal.SIG_IGN) line = re.sub('[^A-Z0-9]+','', sys.argv[1])[:10] flag = line[1] cardID = line[2:] if ( has_access(flag) ): info('<username> has access') username = get_username(cardID) execute_granted_actions(username) else: info('<username> is denied access') execute_denied_actions() exit(0)
def play_sound(path): # TODO: re-enable and test info('playing sound') # run("/usr/bin/play", "-q", path, "trim", "0", "12") return