pfsense-automator
pfsense-automator copied to clipboard
Username & Password not read from CLI
It appears that supplying -u -p on the CLI does not get read unless you have a significantly long arg list.
./pfsense-automator.py 192.168.1.1 --check-auth -u admin -p pfsense
WARNING: Large numbers of authentication failures will enforce a pfSense lockout for your IP address. Proceed with caution.
Please enter username: admin
Please enter password:
Authentication successful
Reviewing the code it appears that you have opted not to use the python argparse utility to capture and enforce command line parameters and have instead opted to hardcode the positional arguments using sys.argv is there a reason for this?
A better way is to read all the variables in via argparse and then use them throughout where needed, this way you avoided repeating your self multiple times.