Skip to content

Commit

Permalink
2.1.2
Browse files Browse the repository at this point in the history
cleaned up argparse, remove obsolete flag logic.
  • Loading branch information
lazymutt committed Mar 16, 2016
1 parent 0a0ab47 commit 702e4c0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 16 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Firmware Password Manager 2.1.1
# Firmware Password Manager 2.1.2

A Python script to help Macintosh administrators manage the firmware passwords of their computers.

Expand Down Expand Up @@ -229,7 +229,8 @@ Thank you to macmule for <http://macmule.com/2014/05/11/ea-check-efi-password-st

Date | Version | Notes
-------|-----------|-------
2016.03.xx | 2.1.1 | Slack identifier flag, logic clarifications.
2016.03.16 | 2.1.2 | Cleaned up argparse, removed obsolete flag logic.
2016.03.16 | 2.1.1 | Slack identifier flag, logic clarifications.
2016.03.07 | 2.1.0 | Obfuscation, reboot flag, bug fixes
2015.11.05 | 2.0.0 | Python rewrite, Docs rewritten
2015.02.25 | 1.0.1 | Added use of firmwarepasswd on 10.10
Expand Down
File renamed without changes.
53 changes: 40 additions & 13 deletions firmware_password_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# 2.1.1 2016.03.16 slack identifier customization,
# logic clarifications. tjm
#
#
# 2.1.2 2016.03.16 cleanup argparse, remove obsolete flag logic. tjm
#
#
# keyfile format:
Expand Down Expand Up @@ -125,18 +125,45 @@ def main():

#
# parse option definitions
parser = argparse.ArgumentParser(description='Manages the firmware password on Apple Computers.')
parser.add_argument('-r', '--remove', action="store_true", default=False, help='Remove firmware password')
parser.add_argument('-k', '--keyfile', help='Set path to keyfile', required=True)
parser.add_argument('-t', '--testmode', action="store_true", default=False, help='Test mode. Verbose logging, will not delete keyfile.')
parser.add_argument('-v', '--version', action='version', version='%(prog)s 2.1.0')
parser.add_argument('-m', '--management', default=None, help='Set nvram management string')
parser.add_argument('-#', '--hash', action="store_true", default=False, help='Set nvram string to hash of keyfile')
parser.add_argument('-n', '--nostring', action="store_true", default=False, help='Do not set nvram management string')
parser.add_argument('-s', '--slack', action="store_true", default=False, help='Send important messages to Slack.')
parser.add_argument('-o', '--obfuscated', action="store_true", default=False, help='Accepts a plist containing the obfuscated keyfile.')
parser.add_argument('-b', '--reboot', action="store_true", default=False, help='Reboots the computer after the script completes successfully.')
parser.add_argument('-i', '--identifier', default=None, required=False, help='Set slack identifier. [IP, hostname, MAC, computername, serial]')
parser = argparse.ArgumentParser(
description='Manages the firmware password on Apple Computers.')

prime_group = parser.add_argument_group('Required management settings',
'Choosing one of these options is required to run FWPM. They tell FWPM how you \
want to manage the firmware password.')
subprime = prime_group.add_mutually_exclusive_group(required=True)
subprime.add_argument('-r', '--remove', action="store_true",
default=False, help='Remove the firmware password')
subprime.add_argument('-m', '--management', default=None,
help='Set a custom nvram management string')
subprime.add_argument('-#', '--hash', action="store_true", default=False,
help='Set nvram string to hash of keyfile')
subprime.add_argument('-n', '--nostring', action="store_true", default=False,
help='Do not set an nvram management string')

keyfile_group = parser.add_argument_group('Keyfile options', 'The keyfile is \
required to use FWPM. These options allow you to set the location and \
format of the keyfile.')
keyfile_group.add_argument('-k', '--keyfile', help='Set the path to your keyfile',
required=True)
keyfile_group.add_argument('-o', '--obfuscated', action="store_true", default=False,
help='Tell FWPM your keylist is an obfuscated plist.')

slack_group = parser.add_argument_group('Slack integration',
'FWPM allows you to send informational and error messages to your Slack team. \
Additionally you can select different methods of identifiying clients.')
slack_group.add_argument('-s', '--slack', action="store_true",
default=False, help='Send important messages to Slack.')
slack_group.add_argument('-i', '--identifier', default=None,
choices=['IP', 'hostname', 'MAC', 'computername', 'serial'],
required=False, help='Set slack identifier.')

parser.add_argument('-b', '--reboot', action="store_true", default=False,
help='Reboots the computer after the script completes successfully.')
parser.add_argument('-t', '--testmode', action="store_true", default=False,
help='Test mode. Verbose logging, will not delete keyfile.')
parser.add_argument('-v', '--version', action='version', version='%(prog)s 2.1.2')

args = parser.parse_args()

if args.testmode:
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='Firmware Password Manager',
version='2.1.1',
version='2.1.2',
url='https://github.com/univ-of-utah-marriott-library-apple/firmware_password_manager',
author='Todd McDaniel, Marriott Library IT Services',
author_email='mlib-its-mac-github@lists.utah.edu',
Expand Down

0 comments on commit 702e4c0

Please sign in to comment.